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 .Connectio n")
ConnSQL_STRING.open "Provider=sqloledb;Data Source=XX.XX.XX.XXX,1433;N etwork Library=DBMSSOCN;Initial Catalog=store2;User ID=xxxx;Password=xxxxxx;"
Set ConnSQL_STRING = Server.CreateObject("ADODB
ConnSQL_STRING.open "Provider=sqloledb;Data Source=XX.XX.XX.XXX,1433;N
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.