What is the alternative to this(that means for �

Results 1 to 4 of 4

Thread: What is the alternative to this(that means for �

  1. #1
    DHEERAN Guest

    Default What is the alternative to this(that means for �

    CONN.BEGINTRANS<BR>ON ERROR GOTO ERRORHANDLER:<BR>CONN.EXECUTE(strQry)<BR>CONN.COMM ITTRANS<BR><BR>ERRORHANDLER:<BR>CONN.ROLLBACKTRANS <BR>RESPONSE.END<BR><BR>Problem: Here Error Handler is not working.What is the alternative to this(that means for &#039rollbacking&#039) ?

  2. #2
    ??? Guest

    Default More info please!


  3. #3
    Join Date
    Dec 1969

    Default Error handling in VBS is primitive

    The *only* help you get is<BR><BR> &nbsp; &nbsp; On Error Resume Next<BR>which says "VBS, ignore all errors that occur" and<BR> &nbsp; &nbsp; On Error GoTo 0<BR>which says "VBS, stop ignoring errors"<BR><BR>When VBS ignores errors, it *still* sets the error condition in the Err object (see docs on Err object in the VBS reference documentation) and/or in the ADODB.Error object that you can get from your ADODB.Connection.<BR><BR>So the normal thing to do would be *something* like this:<BR><BR>&#060;%<BR>CONN.BEGINTRANS<BR>ON ERROR Resume Next<BR>CONN.EXECUTE(strQry)<BR>ON ERROR GOTO 0<BR>If Conn.Error ... Then &#039 I forget the exact syntax, etc.<BR> &nbsp; CONN.COMMITTRANS<BR>Else<BR> &nbsp; CONN.ROLLBACKTRANS<BR> &nbsp; RESPONSE.END<BR>End If<BR>%&#062;<BR><BR>I don&#039t have my ADO ref material handy here at home, so I don&#039t remember the exact way of getting the ADODB.Error object, but I do recall that you get it via the Connection. Just access the MS ADO docs for details.<BR><BR>Okay?<BR><BR>

  4. #4
    DHEERAN Guest

    Default RE: Error handling in VBS is primitive

    &#060;%<BR> conn.errors.clear<BR> Conn.BEGINTRANS<BR> on error resume next<BR> CONN.EXECUTE strDispatchRecall<BR> if err.description = "" then<BR> CONN.COMMITTRANS <BR> Response.Write "committed"<BR> Response.End <BR> else<BR> CONN.ROLLBACKTRANS<BR> Response.Write "rollbacked"<BR> Response.End <BR> end if <BR>%&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts