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

Re: recordsets and error handling by Ken

Ken
Mon Sep 15 21:11:49 CDT 2003

Check if the object is Nothing

?

Cheers
Ken

"JT" <jeffreyl@sppinc.net> wrote in message
news:eSTgYf9eDHA.3024@tk2msftngp13.phx.gbl...
: 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?