Error trapping for ADO

Results 1 to 2 of 2

Thread: Error trapping for ADO

  1. #1
    gboyd Guest

    Default Error trapping for ADO

    How do I trap those errors, so I can not give the user of my site a confusing error message

  2. #2
    Rob Guest

    Default RE: Error trapping for ADO

    Something like this:<BR><BR>set adoConn = Server.CreateObject("ADODB.Connection")<BR>adoConn .Open Application("DataConn")<BR>sSQL = "select * from blah blah"<BR>Set RS = adoConn.execute(sSQL)<BR><BR>IF adoConn.errors.count&#062; 0 then<BR> response.write "Database Errors Occured" & "&#060;P&#062;"<BR> response.write sSQL & "&#060;P&#062;"<BR> for counter= 0 to adoConn.errors.count<BR> response.write "Error #" & adoConn.errors(counter).number & "&#060;P&#062;"<BR> response.write "Error desc. -&#062; " & adpConn.errors(counter).description & "&#060;P&#062;"<BR> next<BR> end if<BR> adoConn.Close<BR><BR>Regards,<BR>Rob

Posting Permissions

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