ADO Err Object Problem

Results 1 to 2 of 2

Thread: ADO Err Object Problem

  1. #1
    Join Date
    Dec 1969

    Default ADO Err Object Problem

    I&#039m developing in ASP 3.0 on IIS 5.0/Win2000 server. I&#039m using MDAC 2.5 to connect to an Oracle database.<BR>When I try to trap an error in an ADO connection, the err object is "empty". I am expecting an err number to be set, but it is not. When I allow IIS to trap the error, I am directed to the standard error page with the error message I am expecting.<BR>When an "IF" is performed on the err object, neither the IF or ELSE clause is executed.<BR>Has anyone seen this or have any suggestions on what to look at to try and find the problem?

  2. #2
    Join Date
    Dec 1969

    Default RE: ADO Err Object Problem

    ADO does not use the Err object.<BR><BR>It uses ADODB.Error which is *not* the same thing.<BR><BR>You might need to do something like<BR><BR>&nbsp;&nbsp;&nbsp;dbConnection.Errors. Clear<BR>&nbsp;&nbsp;&nbsp;On Error Resume Next<BR>&nbsp;&nbsp;&nbsp;... do your SQL stuff...<BR>&nbsp;&nbsp;&nbsp;On Error Goto 0<BR>&nbsp;&nbsp;&nbsp;If dbConnection.Errors.Count &#062; 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For ernum = 1 To dbConnection.Errors.Count<BR>&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<BR>&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;Next<BR>&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;...<BR>&nbsp;&nbsp;&nbsp;Endif <BR><BR>It is quite possible for a single SQL statement to cause multiple errors to be returned, hence the need for the loop.<BR><BR>If you are already doing all this and just used the name "Err" accidentally, apologies and ignore me.<BR><BR><BR><BR><BR>Want to show some code?<BR><BR>

Posting Permissions

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