Errors Collection

        Methods    Properties

An Errors collection contains all stored CdbError objects, each of which pertains to a single operation involving DAO.



Remarks

Any operation involving DAO objects can generate one or more errors. As each error occurs, one or more CdbError objects are placed in the Errors collection of the CdbDBEngine object. When another DAO operation generates an error, the Errors collection is cleared and the new set of CdbError objects 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, so the Errors collection doesn't support the Append and Delete methods.

The set of CdbError objects in the Errors collection describes one error. The first CdbError object is the lowest level error, the second is the next higher level, and so forth. For example, if an ODBC error occurs while trying to open a CdbRecordset object, 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 ODBC driver manager, and possibly the driver itself, return separate CdbError objects. The last CdbError object contains the DAO error indicating that the object couldn't be opened.

Enumerating the specific errors in the Errors collection enables your error-handling routines to more precisely determine the cause and origin of an error, and take appropriate steps to recover.