Link to home
Start Free TrialLog in
Avatar of djbyron
djbyron

asked on

Detect Database Connection and redirect if broken

I'm developing an application that connects to a local SQL Server database via IP address.  The application is working fine but I would like to add a function that checks to make sure the connection is available and if the connection is not available ("SQL Server does not exist or access denied") then I'd like it to be able to redirect to a custom page to notify the visitor.  Here is the connection string I'm using within an include page.

Set ConnSQL_STRING = Server.CreateObject("ADODB.Connection")
ConnSQL_STRING.open "Provider=sqloledb;Data Source=XX.XX.XX.XXX,1433;Network Library=DBMSSOCN;Initial Catalog=store2;User ID=xxxx;Password=xxxxxx;"
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial