Name

Errors Collection — objConn .Errors

Synopsis

Each Connection object has its own Errors collection. ADO adds Error objects to this collection each time the underlying data provider for that Connection object raises an error because of incorrect syntax or lack of support.

Parameters

None

Example

For examples, see the details for the Description, Number, and Source (Error object) properties earlier in this chapter.

Notes

ADO clears the Errors collection of the affected Connection object each time a new error occurs. It does not simply add another Error object to those already in the Errors collection. These added Error objects represent a data provider error, not an ADO or ASP error. For this reason, even if ADO adds an Error object to a Connection object's Errors collection, that error does not trigger a runtime error (which could be caught by a script's On Error trap) unless there is also a corresponding ADO error.

Every Error object currently in the Errors collection of a given Connection object represents error information raised by the data provider for a single error-causing operation on the data.

Note that if you have code in your scripts that reacts programmatically to errors in the Connection object's Errors collection, you may want to consider moving this error handling to the 500-100.ASP (or customized equivalent) error page, if you are using IIS 5.0 or higher. For more information on use of the 500-100.ASP error handling page used by IIS 5.0, see Chapter 5.

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.