Error Object

An Error object can contain the details of a data provider error. These provider errors can result from incorrect use of ADO syntax, or from lack of support for a particular property or method by the underlying data provider. It is important to realize that the Error object represents the details of an error from the provider, and not from ADO. ADO errors are caught by the web server at execution time as runtime errors.

Provider errors are specific to a particular Connection object. When an error occurs with the data provider, one or more errors are raised by that provider and added to the Connection object's Errors collection, which is cleared each time a new operation causes an error to be returned from the data provider.

From the Error object, you can retrieve the name, number, and description of each error caused by the invalid operation. In addition, you can retrieve Help information and information about the state of the data provider from the Error object. Table 12.9 lists the Error object's properties; it has no collection objects or methods.

Table 12.9. Error Object Properties

Property

Description

Description[13]

The descriptive string associated with a given error. This descriptive string can be set by ADO or by the data provider.

HelpContextID

The value of a Help file's context ID, if the accompanying HelpFile property indicates that there is a Windows help file associated with an Error object.

HelpFile

A string that evaluates to the path and ...

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.