ADO » Objects » Error

The ADO Error object contains detailed information about any data access errors or warnings that have been generated during a single operation.

When an error occurs, the provider is responsible for passing an error text to ADO. In turn, each time an error or warning occurs, ADO generates an Error object which contains the details of the specific error. Each of these Error objects is then stored in the Errors collection, which is a collection that is unique to the Connection object. In order to access these errors, you must refer to the specific connection.

Remember, each Error object contains only one error. Since multiple errors might have occurred, you may need to enumerate through the collection of Error objects.

Examples

Code:
For Each objError in objConnection.Errors
   Response.Write objError.Description & VBCRLF
Next

Properties

Description

Syntax: string = errorobject.Description

Returns a string that describes the error. This is the default property.

HelpContext

Syntax: long = errorobject.HelpContext

Returns a long value that is the context ID in the help file (if it exists) for the error.

HelpFile

Syntax: string = errorobject.HelpFile

Returns a string that is the path and name of the help file (if it exists).

NativeError

Syntax: long = errorobject.NativeError

Returns a long value that is the database error information for a specific Error object.

Number

Syntax: long = errorobject.Number

Returns a long value that is the unique number that identifies an Error object.

Source

Syntax: long = errorobject.Source

Returns a string that is the name or ID of the object or application that generated the error.

SQLState

Syntax: long = errorobject.SQLState

Returns a five character string that is the SQL error code.