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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing SERVER Status

Status
Not open for further replies.

NikP

Programmer
Mar 1, 2001
18
GB
Hi I have an ASP site which is runnig of an NT Server however it uses an ODBC connection to connect to another server to access the dB....the server with the dB sometimes is down....and therefore I get an error on the page saying SERVER NOT FOUND etc....How can i detect if the server with the dB is runing so I can put a page up which tells the users that the site is down for while etc....

Any help would be great thanks

Nik

 
No experience with DB on another server but can't you use
Code:
DIM strResponse
ON ERROR RESUME NEXT
    objConn.Open(.....)
    IF ERR > 0 THEN
        strResponse = Err.Description
    END IF
ON ERROR GOTO 0
 
Yes, and even to take it one step further, you could display your users a message like this:

DIM strResponse
ON ERROR RESUME NEXT
objConn.Open(.....)
IF ERR > 0 THEN
strResponse = Err.Description
response.write(&quot;<h1 align=center>Sorry, the site is down right now</h1>&quot;)
response.end
END IF
ON ERROR GOTO 0

so that if an error occurs, you just show them a message and stop output right there...

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top