recordsets and error handling

J

JT

any suggestions on the correct way to do this?

if my procedure fails to run, then my .dll sets errorFlag = 1, but the
problem is i also need to check for errors coming back from the db upon
succesful completion of my procedure.

however, if my procedure fails to run, then i obviously do not have a
recordset - in this case i keep getting this strange error that is occurring
becasue i'm referencing a recordset that is not there. is there a way to
check for the existence of a recordset before referring to it?

here is my sample code:

'if error flag from objDBInterface = 1, then we know the procedure did not
run -
'probably procedure was not found or parameters were incorrect

If objDBInterface.ErrorFlag = 1 Then

set objDBInterface = nothing
session("err_flag") = 100


'or elseif field 'err_for_asp' returned -1 then the procedure ran but came
back with an error
'check tErrors for more details

Else if rs.Fields("err_for_asp") = "-1" Then
rs.Close
set objDBInterface = nothing
session("err_flag") = 101
End If


tia
jt
 
K

Ken Schaefer

Check if the object is Nothing

?

Cheers
Ken

: any suggestions on the correct way to do this?
:
: if my procedure fails to run, then my .dll sets errorFlag = 1, but the
: problem is i also need to check for errors coming back from the db upon
: succesful completion of my procedure.
:
: however, if my procedure fails to run, then i obviously do not have a
: recordset - in this case i keep getting this strange error that is
occurring
: becasue i'm referencing a recordset that is not there. is there a way to
: check for the existence of a recordset before referring to it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top