recordsets and error handling

Discussion in 'ASP General' started by JT, Sep 15, 2003.

  1. JT

    JT Guest

    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
     
    JT, Sep 15, 2003
    #1
    1. Advertising

  2. JT

    Ken Schaefer Guest

    Check if the object is Nothing

    ?

    Cheers
    Ken

    "JT" <> wrote in message
    news:...
    : 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?
     
    Ken Schaefer, Sep 16, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AFN
    Replies:
    5
    Views:
    419
    dilipdotnet at apdiya.com
    Feb 11, 2004
  2. Sky
    Replies:
    2
    Views:
    377
  3. =?Utf-8?B?TWFkaXNvbg==?=

    SqlDataSource and multiple recordsets

    =?Utf-8?B?TWFkaXNvbg==?=, Jul 24, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    843
    Cowboy \(Gregory A. Beamer\)
    Jul 24, 2007
  4. Boardrider

    Classes and recordsets

    Boardrider, Nov 3, 2003, in forum: ASP General
    Replies:
    1
    Views:
    152
    Ray at
    Nov 3, 2003
  5. Stuart

    arrays and recordsets

    Stuart, Jan 7, 2004, in forum: Javascript
    Replies:
    4
    Views:
    134
    Thomas 'PointedEars' Lahn
    Jan 25, 2004
Loading...

Share This Page