We need to take the database server down for an hour or two once in a while, our visitors have been getting the white background internal server error message when the db server is down. Is there a way to make a more friendly looking page? instead of the generic looking default page from IIS? At least put our logo on it and tell visitors the site will be back shortly... We don't take the web server down at all, only the db server requires periodic maintenance every once in a while. This is for IIS 6.0 / WIn2003. Thanks!
hi, I will be check database query error message after every transaction, and if you have one than its will be show my out of service web page. Rudolf
Depends on the what code you use asp or asp.net IN CASE OF CLASSIC ASP you can use ON ERROR RESUME NEXT IN CASE OF ASP.NET TRY CATCH FINALLY whenever you catch an database connection error, you can redirect to an customer error page like maintenance.html This will look fine when there is a real database error, or deliberate database maintenance. OR you could add a single line of redirect code on top of all the pages during the maintenance. tell me the scripting technology, i will paste the code
How is your connection string is placed, it is in all pages seperately. Or did u create a single asp file that has the connection string and named as connection.asp or(myconnection.asp) then added this file in all asp pages as SERVER SIDE INCLUDE(THIS IS WHAT WE ALL DO), if this is the case it is easy to maintain. No matter i will paste the snippet 'response.Redirect("maintenance.asp") server.ScriptTimeout=180 dim objconn, straddress, strconnect straddress = server.MapPath("db\MYDATABASE.mdb") ' Finding the root path of the database strconnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source = " & straddress & ";" &" Persist Security Info=False" ' connection string required to open database for OLEDB DRIVER set objconn=server.CreateObject("adodb.connection") ' Creating an ADODB CONNECTION OBJECT On Error resume Next objConn.open strconnect ' Opening the adodb object If Err.Number <> 0 then response.Redirect("maintenance.asp") Error.Clear End If Code (markup): the above is an example for access database, in case of deliberate maintenance you can remove the single quote in the first line.