Click to See Complete Forum and Search --> : ADO error trapping in ASP
daljeet
Dec 29th, 1999, 01:18 PM
I'm using ADO in ASP page. I want to trap the error that would occur when my query to the database fails. Though I check the Errors collection soon after the Execute method of the Connection object, but the ASP page displays the error message immediately after the Execute method. In my case, the query is failing, due to primary key constraint.
Francis
Dec 29th, 1999, 07:36 PM
I didn't understand...did you use something like:
On error goto errorlabel
<your code>
exit sub (or function)
errorlabel:
msgbox <your message>
?
Didn't it work?
Bye, Francis
Clunietp
Dec 29th, 1999, 09:14 PM
I don't believe you can use Goto statements in VBScript. If you want a generic message "there was an error" instead of the details, go into the IIS --> Properties of web application --> configuration --> click on the APP DEbugging tab, then click 'SEND TEXT ERROR MESSAGE TO CLIENT'. that will do what it says instead of giving you a detailed message.
HTH
Tom
Serge
Dec 30th, 1999, 11:33 AM
Tom is right, in VBScript you can only resume next:
On Error Resume Next
------------------
Serge
Software Developer
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.