Trap & Clear

Results 1 to 2 of 2

Thread: Trap & Clear

  1. #1
    Join Date
    Dec 1969

    Default Trap & Clear

    How do I trap and clear an ADODB.Recordset Error? I&#039ve tried err.Clear but it didn&#039t work as in...<BR><BR>if err.Number &#060;&#062; 0 Then<BR> err.Clear<BR>end if<BR><BR>I&#039ve also tried<BR>Set objErr = Server.CreateObject("ADODB.Error")<BR>For Each objErr In objConn.Errors<BR> Response.Write "An Error Has Occurred!"<BR>Next<BR><BR>Nothing happened. Why doesn&#039t err.Clear work? has anyone tried it? I&#039m using an access db.

  2. #2
    Join Date
    Dec 1969

    Default RE: Trap & Clear

    This is an ADO error, so you need to clear the errors collection of the connection object.<BR><BR>&#039Set objErr = Server.CreateObject("ADODB.Error")<BR>&#039Don&#03 9t need to instantiate the error object (I don&#039t think!)<BR>For Each objErr In objConn.Errors<BR>Response.Write objErr.Description & "-" & objErr.Source<BR>Next<BR>objConn.Errors.Clear

Posting Permissions

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