Is there a simple way to check if a connection string was successful in connecting to the specified database:
Scenario:
Connection string example:
ConnString="DRIVER={MySQL ODBC 5.1 Driver}; SERVER=###.###.####.##; PORT=3306; DATABASE=DbName; USER=DbUser; PASSWORD=DbUser_Pswrd; OPTION=3;"
If the above fails, to logon for example, as the MySQL server is currently offline or whatever is there a simple way to check that there is an issue rather than the generic error 80004005 being thrown as explained below?
Solution to this is to solve error above being thrown when a page loads where the following line(s) in the code causes error as connection is not able to connect to the database:
rs.ActiveConnection = connString
I want to catch this connection issue before the above line is read so that I can redirect to a page that has no connection string and display a message saying the server is currently offline etc.
I just need the catch error code please.