I've used code like this before:
On Error Resume Next
Conn4.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=CD;" & _
"User Id=username;" & _
"Password=password"
Select Case True
Case Err.Number = 0
''logged in fine
Case Instr(Err.Description, "does not exist") > 0
Response.Write "That user doesn't exist."
Case Instr(Err.Description, "some other error string") > 0
Response.Write "Some other error that you'd like the user to see."
End Select
On Error Goto 0
My actual code:
Set objADO = Server.CreateObject("ADODB.Connection")
objADO.Open TheConnectionStringVariableWithUIDandPwd
Select Case True
Case Err.Number = 0
'''fine, continue
blnContinue = True
Case Instr(Err.Description, "does not exist") > 0
Response.Write "User " & strUsername & " does not exist on our AS/400."
Case Instr(Err.Description, "is not correct") > 0
Response.Write "The password you entered for " & strUsername & " is not
correct. Please go back and try again."
Case Instr(Err.Description, "has been disabled") > 0
Response.Write strUsername & " is disabled on the AS/400 and will need to
be reset."
Case Else
Response.Write "An unknown error has occurred. Sorry about that."
End Select
Ray at work
"Colin Steadman" <ms**@PlsIGnoreTH1sBiTcolinsteadman.com> wrote in message
news:05****************************@phx.gbl...
I have built a page that lists all our databases, the
users connected to each database, and what application
they are using. Because these databases are moved, or
removed from time to time I need to check if the database
still exists before trying to query it. Otherwise I get
funny SID errors when it tries to process this command:-
Conn4.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=CD;" & _
"User Id=username;" & _
"Password=password"
Can this be done in ASP or should I be querying the error
collection or something?
TIA,
Colin