The Errors collection contains all Error objects created by a response to a provider-related failure. The Error object contains the details about the error; it also has properties and methods you can use within your code. Any operation that involves an ADO object can generate errors. Every time another error occurs for the same object, an additional Error object is added to the Errors collection.
One caveat of error processing is that when a new ADO operation generates an error, the Errors collection is cleared and a new set of Error objects can be added to the Errors collection. It is common to use error-handling routines to examine the Error objects in the Errors collection to react to possible errors. This allows you to display helpful error messages in plain language rather than relying on the system to generate errors that are incomprehensible to inexperienced users.
The various properties of the Errors collection are summarized in the following table.
|Count||Long||Returns the number of error objects stored in the Errors collection.|
|Item||String or Long||References a specific member of the Errors collection by name or ordinal number.|
The following table describes the methods available for the Errors collection.
|Clear||Removes all Error objects from the Errors collection.|
|Refresh||Updates the Errors collection to encompass ...|