can someone help me?

sometimes when my page (connecting with MySQL database) can't open normally, page will like this :

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[TCX][MyODBC]Can't connect to MySQL server on 'server.doreminow.com' (10061)

even this only for a while (5 - 10 minutes) but this bother me.
can i detect connection between my asp page with MySQL server? if MySQL is running then page will open normally and if MySQL server is off then page will redrect to 'maintenance page'.

THX.

This was posted on a previous thread.

<%
On Error Resume Next
Dim sConnection, objConn , objRS

sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=Your_Mysql_DB; UID=mysql_username;PASSWORD=mysql_password; OPTION=3"

Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open(sConnection) 
If Err.Number <> 0 Then
Response.Redirect "maintenance.asp"
Response.End
Else
'continue coding here
'...

objConn.close
Set objConn=Nothing
End If

%> 
Here is the link. http://www.daniweb.com/forums/thread246846.html
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.