I am using classic ASP to query an oracle database. On the weekends, backups take place for oracle database and the oracle system is unavailable. When this happens, asp pages stop working. .htm pages work, but not .asp.
I have the standard error checking code:
If Err.Number <> 0 Then
s_error_msg = "Error occured while opening the database." & Err.Description & "."
Response.Write(s_error_msg
& "<br><br>")
Response.End()
End if
I have tested and this works for my access databases, but not my oracle database.
I have been searching google non-stop. Does anyone have any ideas.
I found this:
http://www.experts-exchange.com/Database/Oracle/8.x/Q_24466566.html?sfQueryTermInfo=1+10+30+asp+oracl
but that is sporadic. This is a sure thing every time the oracle database goes down.
I appreciate all the help.
'Enter entire Oracle connection string and test to ensure code is working before testing for db being down.
Set o_conn = Server.CreateObject("ADODB
'o_conn.Open application("QUARTZ_INTERN
'o_conn.Open application("SarAccess_Con
o_conn.Open application("TeamTrackProd
'response.write(o_conn.Sta
'o_conn.ConnectionTimeout=
'Retrieves the distinct country that is used in s_sql2
s_sql1 = " select * " & _
" from custom.cudw_quality_intran
" order by source_system, country "
'Response.Write "DEBUG: " & s_sql1 & "<HR>"
'Response.End
Set o_Rs1 = o_conn.Execute(s_sql1)
oops = False ' set to true if we get any error. We are doing this on the assumption that if db is down, you get server error.
'200 means success server access.
If o_Rs1.EOF Then
%>
<span class=middletitle style="font-size: small; font-weight: bold;">
Sorry database is currently down for maintenance. Check back shortly </span>
<%
Else
Do Until o_Rs1.EOF
process infor from db here
end if
If http.Status <> 200 Then
' let users know server is down!!!
Response.Write "ERROR: Status " & http.Status & " received from server."
' exit from the program
oops = True
Exit Do
End If
o_Rs1.MoveNext
Loop
' tell server we are done with with collecting data!
done = "DONE"
If oops Then done = "ERROR" 'kick back to error message.
%>
sorry, didn't test because I don't have oracle but I modeled after a working code