ASP Database Connect Error Handling File
This routine should be called by ...
On Error Resume Next
Conn.Open "DSN_Name", "SQL_User", "SQL_Password"
Call ErrorADOReport()
'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>*
' Subs for ODBC Error handling.....
'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>*
Private sub ErrorADOReport
HowManyErrs = Conn.errors.count
If HowManyErrs = 0 then
' goody
Exit Sub
Else
' baddy
For counter= 0 to HowManyErrs-1
DBErrorNum = conn.errors(counter).number
DBErrorDesc = conn.errors(counter).description
SELECT CASE DBErrorNum
Case -2147467259
''''''''''''''''''''''''''''''''''''''''''''''
' Fatal Error DSN not found - redirect to page
''''''''''''''''''''''''''''''''''''''''''''''
' DO SOMETHING
Case -2147217843
''''''''''''''''''''''''''''''''''''''''''''''
' Fatal Error Bad Login - redirect to page
''''''''''''''''''''''''''''''''''''''''''''''
' DO SOMETHING
Case Else
''''''''''''''''''''''''''''''''''''''''''''''
' Error not defined (here)
''''''''''''''''''''''''''''''''''''''''''''''
' DO SOMETHING
END SELECT
Next
End If
End Sub