Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



ADO Errors Collection Remarks


Any operation involving ADO objects can generate one or more provider errors. As each error occurs, one or more ADO Error Object objects may be placed in the Errors collection of the ADO Connection Object. When another ADO operation generates an error, the Errors collection is cleared, and the new set of Error objects may be placed in the Errors collection.

Each Error object represents a specific provider error, not an ADO error. ADO errors are exposed to the run-time exception-handling mechanism. For example, in Microsoft Visual Basic, the occurrence of an ADO-specific error will trigger an On Error event and appear in the Err object.

ADO operations that don't generate an error have no effect on the Errors collection. Use the ADO Collections Clear Method to manually clear the Errors collection.

The set of Error objects in the Errors collection describes all errors that occurred in response to a single statement. 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.

Some properties and methods return warnings that appear as Error objects in the Errors collection but do not halt a program's execution. Before you call the ADO Recordset Object Resync Method, ADO Recordset Object UpdateBatch Method, or ADO Recordset Object CancelBatch Method methods on an ADO Recordset Object, or before you set the ADO Recordset Object Filter Property on a Recordset object, call the Clear method on the Errors collection so that you can read the Count Property of the Errors collection to test for returned warnings.

Note icon Note See the ADO Error Object for a more detailed explanation of the way a single ADO operation can generate multiple errors.


ContentsPreviousNextIndex