Name

Error Object

Synopsis

Dim error As ADODB.Error

The Error object contains information regarding a particular error or warning that was raised by a data provider during an ADO operation.

Applies To

Errors

Contains one or more Error objects that hold information about errors or warnings raised by ADO during an operation.

Properties

Description

Describes the error or warning either ADO or the data provider has generated.

HelpContext

Indicates the topic within a help file for a particular error within an Error object.

HelpFile

Indicates the name of a help file that contains a topic for a particular error within an Error object.

NativeError

Returns the error code supplied by the data provider for the current Error object.

Number

Uniquely identifies the error specified by the current Error object.

Source

Returns the name of an object or application that generated an error within ADO.

SQLState

Returns the SQL state of the current Error object.

Description

It is important to remember that these errors are not ADO errors, but rather data-provider errors. ADO errors are reported by the development languages default error-handling mechanism (in Visual Basic, this is the On Error statement and the Err object).

When a data provider reports an error for a single ADO operation, ADO clears the contents of the Errors collection and populates the collection with an Error object for each error or warning. Data providers can generate warnings, but they do not halt the execution of an operation.

Because the Errors collection ...

Get ADO: ActiveX Data Objects 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.