'turn on error handling
On Error Resume Next
'try to do what you're doing - here I'm trying
'to open a connection to a database
objConn.Open "DSN=whatever;PWD=whatever
'test for the error
If objConn.Errors.Count > 0 Then
'do whatever you want
End If
'turn error checking off
On Error Goto 0
As canadian5 said, you can also check ther Err object rather than the error collection of the object you're working with (I was using the connection object above). Hope that helps.
Main Topics
Browse All Topics





by: canadian5Posted on 1999-10-20 at 06:53:13ID: 2141877
Try
On Error Resume Next
And for error handling I believe you use
If err <> 0 then
....
end if
On Error Goto doesn't work in VBScript to my knowledge.