title: Check if Connection is OK in Classic ASP
body: <p>Is there a simple way to check if a connection string was successful in connecting to the specified database:</p>
  
  <p>Scenario:</p>
  
  <p>Connection string example: </p>
  
  
  
  <pre class="lang-vb prettyprint-override"><code>ConnString="DRIVER={MySQL ODBC 5.1 Driver}; SERVER=###.###.####.##; PORT=3306; DATABASE=DbName; USER=DbUser; PASSWORD=DbUser_Pswrd; OPTION=3;"
  </code></pre>
  
  <p>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?</p>
  
  <p>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:</p>
  
  <pre class="lang-vb prettyprint-override"><code>rs.ActiveConnection = connString
  </code></pre>
  
  <p>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.</p>
  
  <p>I just need the catch error code please.</p>