Now, i know why the connection failed as it was deliberate on my part to cause this error. I want to trap this error and convert it to text to say the database is not available, such as when it is shut down to do software maintenance on it, etc., rather than display the error message like the one given above.

How do i trap this error and convert it into some meaningful text on the web page to say the database is not available?

Thank you. I'm not so much concerned about the error codes, etc., as i already have these defined. What I'm trying to do is to catch the failed connection event and convert the connection failure into words like "Database Unavailable" on the web page rather than showing the default error message as noted previously.

Trying to find that in MSDN is like looking for a needle in a haystack.

If I understand you correctly you could call an error handling function, with the error number as a parameter. That function could contain a switch statement that takes the parameter and returns any words you want, based on the error number (parameter).

Or are you asking for help trapping the errors? I guess I don't understand completely.

ON ERROR RESUME NEXTconntemp.open myDSN 'This activates the database connection, as given above this code.IF ERR.NUMBER <>0 THEN 'There is far more than just one error code for this failure. Hence, "<> 0 ".DBConnection="0"ELSEDBConnection="1"END IFERR.CLEAR

Then in the web page, retrieve the value for DBConnection and evaluate it. Where DBConnection="0", this indicates a failure to connect. For connection failuire, display the text "Database Unavailable" on the web page, otherwise, continue with producing the asp web page normally.

Testing has shown it to work well. Now implementing it into the production system.

I haven't used vbscript in many years but I don't think it supports try/catch (unless it was added in recent years). In that case 'ON ERROR RESUME NEXT' is the way to go. I believe there should be a 'On Error GoTo 0' at the end, to turn on error checking again.