Results 1 to 4 of 4

Thread: ADO error trapping in ASP

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Posts
    23

    Post

    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.

  2. #2
    New Member
    Join Date
    Jan 1999
    Posts
    5

    Post

    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

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Tom is right, in VBScript you can only resume next:
    On Error Resume Next


    ------------------

    Serge

    Software Developer
    [email protected]
    ICQ#: 51055819


Posting Permissions

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



Click Here to Expand Forum to Full Width