>

Errors Collection

Description

The Errors collection contains all stored Error objects, each of which pertains to a single operation involving data access objects (DAO).

Remarks

Any operation involving data access objects can generate one or more errors. As each error occurs, one or more Error objects are placed in the Errors collection of the DBEngine object. When another DAO operation generates an error, the Errors collection is cleared, and the new Error object is placed in the Errors collection. DAO operations that don't generate an error have no effect on the Errors collection.

Elements of the Errors collection aren't appended as they typically are with other collections.

The set of Error objects in the Errors collection describes one error. The first Error object is the lowest level error, the second the next higher level, and so forth. For example, if an ODBC error occurs while trying to open a Recordset object, the last Error object contains the DAO error indicating that the object couldn't be opened. The first error object contains the lowest level ODBC error; subsequent errors contain the ODBC errors returned by the various layers of ODBC. In this case, the driver manager, and possibly the driver itself, return separate Error objects.

Note

If you use the New keyword to create an object that causes an error either before or while being placed into the Errors collection, the collection doesn't contain error information about that object (because it might contain information from a previous error).

The error information is available in the Visual Basic Err object.

Properties

Count Property.

Methods

Refresh Method.

See Also

Appendix, "Data Access Object Hierarchy."

Example (Microsoft Access)

See the Error object example (Microsoft Access).