General Differences

Three distinct object models in ADO together provide the functionality found in DAO. These three models are ADO (ADODB), Microsoft ADO Extensions for DDL and Security (ADOX), and Microsoft Jet and Replication Objects (JRO). The functionality of DAO is divided among these three models because many applications will need just one of these subsets of functionality. By splitting the functionality out, applications do not need to incur the overhead of loading additional information into memory unnecessarily. The following sections provide an overview of these three object models.

ADO: Data Manipulation

ADO enables your client applications to access and manipulate data through any OLE DB Provider. ADO contains objects for connecting to a data source and reading, adding, updating, or deleting data.

Figure 1. ADO object model

The ADO Connection object defines a session for a user of a particular data source. This differs from DAO, in which the Workspace object defines the session for a user and the Database object defines the data source.

The ADO Command object is similar to the DAO QueryDef object in that both objects can be used to execute an SQL statement against a data source. Likewise, the Recordset object in both ADO and DAO can be used to view the contents of a table or the results from executing an SQL statement.

ADOX: Data Definition and Security

The ADOX model contains objects for data definition (such as tables, views, and indexes) and creating and modifying users and groups. With ADOX an administrator can control database schema and grant and revoke permissions on objects to users and groups.

Figure 2. ADOX object model

The Catalog object is the container for the data definition collections (Tables, Procedures, and Views) and the security collections (Users and Groups). This differs from DAO, in which the Database object contains the data definition collections and the Workspace object contains the security collections. Each Catalog object is associated with only one Connection, whereas a DAO Workspace may contain multiple Databases.

The Table, Index, and Column objects in ADO are roughly equivalent to the TableDef, IndexDef, and Field objects in DAO. Each of these objects also has a standard ADO Properties collection.

Figure 3. ADOX object model

JRO: Replication

The JRO model contains objects, properties, and methods for creating, modifying, and synchronizing replicas. It is designed specifically for use with the Microsoft Jet Provider. Unlike ADO and ADOX, JRO cannot be used with data sources other than Microsoft Jet databases.

The primary object in the JRO model is the Replica object. The Replica object is used to create new replicas, to retrieve and modify properties of an existing replica, and to synchronize changes with other replicas. This differs from DAO, in which the Database object is used for these tasks.

JRO also includes a JetEngine object for two specific Microsoft Jet database engine features: compacting the database and refreshing data from the memory cache.

Figure 4. JRO object model