Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error trapping a database connection

Status
Not open for further replies.

colly24

Technical User
Jun 27, 2002
11
US
Hi,
i want to perform error trapping on the connection to a server, so if the SQL server is inaccessible the site does not crash. I'm using javascript and hoped the try...catch might work

this is want I've tried, this code is contained within existing ASP script:

%>
try
{
"<%strTRSConnect.Open App_TRSConnectionString%>";
}
catch(e)
{
alert("Error occurred ::::" + e.description)
}
<%

where App_TRSConnectionString is declared elsewhere.
It still attempts to connect and because i'm testing with an inappropriate connection string the page crashes.

any help would be great
 
It looks like you are mixing client-side code with your ASP.

Do you mean to open this ADO connection from your ASP page or are you intending the browser to do it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top