ADO Object Reference: Data Access Components
ADO Recordset Object Fundamentals
A Recordset object represents the entire set of records from a table or the result of an executed command. At any time, the Recordset object refers to only one record within the set, known as the current record.
Recordset Object Details
Recordset objects are crucial for manipulating data from a provider. When using ADO, data is almost entirely handled by Recordset objects. All Recordset objects are composed of records (rows) and fields (columns). Depending on the functionality supported by the provider, some methods or properties of the Recordset object may not be available.
There are four different types of cursors in ADO:
- Dynamic Cursor: Allows you to view additions, amendments, and deletions made by other users. It permits all types of movement through the Recordset that are related to bookmarks, and allows bookmarks if the provider supports them.
- Keyset Cursor: Behaves like a dynamic cursor, except that it does not show records added by other users and denies access to records deleted by other users. Changes in data made by other users are still visible. It always supports bookmarks and therefore allows all types of movement through the Recordset.
- Static Cursor: Provides a static copy of a recordset, ideal for data searching or report generation. It always allows bookmarks and therefore permits all types of movement through the Recordset. Additions, modifications, or deletions made by other users will not be visible. This is the only type of cursor enabled when you open a Recordset object on the client side (ADOR).
- Forward-Only Cursor: Behaves identically to the dynamic cursor, except that it only allows forward movement through the records. This significantly increases performance in situations where you only need to make a single pass through a Recordset.
ADO Field Object Explained
A Field object represents a column of data with a common data type.
Field Object Specifics
A Recordset object has a Fields collection consisting of multiple Field objects. Each Field object corresponds to a column in the Recordset. The Value property of Field objects is used to set or retrieve data from the current record. Depending on the functionality offered by the provider, some collections, methods, or properties of a Field object may not be available.
ADO Parameter Object Usage
A Parameter object represents a parameter or argument associated with a Command object, typically based on a parameterized query or stored procedure.
Parameter Object Functionality
Many providers support parameterized commands. These are commands where the desired action is defined once, but variables (or parameters) are used to modify certain details of the command. For example, a SQL SELECT
statement could use a parameter to define the search criteria in the WHERE
clause and another to set the column name for the ORDER BY
clause.
ADO Property Object Characteristics
A Property object represents a dynamic characteristic of an ADO object, defined by the provider.
Property Object Types
ADO objects have two types of properties: intrinsic and dynamic.
ADO Command Object Operations
A Command object defines a specific command that you plan to execute against a data source.
Command Object Applications
Use a Command object to query a database and retrieve records into a Recordset object, to perform bulk data management operations, or to manipulate the structure of a database. Depending on the provider’s functionality, some collections, methods, or properties of a Command object may not be available when referenced.
ADO Connection Object Management
A Connection object represents an open connection to a data source.
Connection Object Session Details
A Connection object represents a unique session with a data source. In the case of a client/server database system, this may be equivalent to a current network connection to the server. Depending on the functionality supported by the provider, some collections, methods, or properties of a Connection object may not be available.