ADO objects provide you with fast and easy access to all types of data. The ADO object model has three main components: the Connection object, the Command object, and the Recordset object. The following illustration shows how the ADO objects relate to one another.
The ADO object model differs from the RDO and DAO object models in that many of the objects can be created independently of one another. For example, you can create a Recordset object without first explicitly creating a Connection object. ADO implicitly creates the required Connection object for you.
To see an animation about the ADO object model, click your modem speed or Download below.
![]() ![]() ![]() ![]() |
(Requires the Microsoft Windows Media Player.) |
The three main components of the ADO object model are the Connection object, the Command object, and the Recordset object.
The Connection object is the highest-level object in the ADO object model. It is used to make a connection between your application and an external data source, such as Microsoft SQL Server.
The Command object is used to build queries, including user-specific parameters, to access records from a data source. Typically, these records are returned in a Recordset object.
The Recordset object is used to access records returned from a SQL query. Using this object, you can navigate returned records, modify existing records, add new records, or delete specific records.
ADO supports three collections: the Errors collection, the Parameters collection, and the Fields collection. While these collections can provide additional functionality to an application, they are not required to build ADO solutions.
The Errors collection is used to return detailed information about run-time errors or other messages returned from a data source.
The Parameters collection is used to pass specific data to a parameterized query or stored procedures in a SQL Server database.
The Fields collection is used to access specific fields in an existing Recordset object.