Results 1 to 3 of 3

Thread: SpiderOne

  1. #1
    Recorset Error Guest

    Default SpiderOne

    Is there a way to do custom Error handleling with Error&#039;s with the recordset object.<BR><BR><BR>Thanks

  2. #2
    Charles Guest

    Default It's possible

    Active Server Page 2.0 Professional has a section on custom error handling database connections.<BR>The problem is that errors come from 2 places.<BR>The errors object of the connection object holds errors generated by the data source.<BR>The err object (VBScript) holds errors generated by objects such as ADO.<BR><BR>For example, the AddNew method reports errors in the err object.<BR><BR>The basic structure the book suggests is:<BR>1. Start your database code with: On Error Resume Next<BR>2. After attempting to perform an action check connection.Errors.Count for a number greater that zero.<BR>3. Also check Err.Number for a number greater that zero.<BR> If greater than 0, Err.Number hold the error number<BR> Err.Source holds the sorce of error<BR> Err.Description hold a description of error<BR><BR>Using this information you can write code to handle errors instead of just having your code halt and dump parts of the source. The Err object will also let you raise your own custom error messages. You just have to use a numbering scheme that does not step on the built in err numbers.<BR><BR>Also the error object of the connection object also has properties that hold description, number, source and a few others that allow you to determine where the error came from (i.e. ADO error, provider error, sql error).<BR><BR>Hope this helps<BR>Charles

  3. #3
    SpiderOne Guest

    Default RE: It's possible

    Thanks C

Posting Permissions

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