ADO API Reference (ADO Collection)

zhaozj2021-02-17  49

Errors collection

Contains all Error objects generated when responding to a single failure involving the provider.

Description

Any operation involving an ADO object can generate one or more provider errors. When an error is generated, one or more Error objects can be placed in the ERRORS collection of the Connection object. When other ADO operations generate an error, the ERRORS collection is cleared and the new ERROR object is placed in the Erroors collection.

Error objects represent a specific provider error, not an ADO error. The ADO error is recorded in the operating mechanism at runtime. For example, in Microsoft Visual Basic, an error that occurs a specific ADO will lead to an ORROR event and the error will appear in an ERR object.

There is no impact on the ERRORS collection without errors. Use the clear way to handle the ErrorS collection.

Error object set in the ERRORS collection describes all errors generated when responding to a single statement. Level ERRORS collection The specified error can make the error handling routine more accurately determine the cause of the error and the source of the error, and perform the appropriate reduction step.

Some properties and methods will return a warning displayed as an Error object in an ErrorS collection, but does not abort the execution of the program. Clear methods on the ERRORS collection before calling the RECORDSET object on the RECORDSET object. This way you can read the ownt property of the ErrorS collection to test the returned warning.

Note For a detailed description of a single ADO operation to produce multiple errors, see the ERROR object topic.

Fields collection

Contains all Field objects of the Recordset object.

Description

The Recordset object includes a Fields collection consisting of field objects. Each Field object corresponds to a column in the Recordset. You can populate the fields collection before the Refresh method on the collection is turned on.

Note For details on how to use the Field object, see the field object topic.

Parameters collection

Contains all Parameter objects for the Command object.

Description

The Command object has a parameters collection consisting of Parameter objects.

Use the Refresh method on the Parameters collection of the Command object, you can get the parameter information about the stored procedures or parameterized queries specified in the Command object. Some providers do not support stored procedures for calling or parameterized queries, and the refresh method that calls the Parameters collection when using such providers will return errors.

If you do not defin the Refresh method, you have not defined your own parameter object to access the Parameters collection, the ADO will automatically call the method and populate the collection.

If you know the properties of the parameters associated with the stored procedure or parameterized query to be called, you can minimize the call to the provider to improve performance. Using the CreateParameter method, you can create a Parameters object with the appropriate properties, using the Append method to add it to the parameters collection. This will allow you to set and return the parameter values ​​without calling the provider of parameter information. If you are writing to the provider that does not provide parameter information, you must use this method to manually populate the parameters collection to use parameters. If necessary, you can use the Delete method to remove the Parameters object from the Parameters collection.

Properties collection

Contains all Property objects of a particular object instance.

Description

Some ADO objects contain a Property collection consisting of Property objects. Each Property object corresponds to the characteristics of the ADO object specified to the provider. Note For a detailed description of how to use the Property object, see the Property object topic.

转载请注明原文地址:https://www.9cbs.com/read-29978.html

New Post(0)