Migrating from DAO to ADO

Using ADO with the Microsoft Jet Provider

Alyssa Henry
Microsoft Corporation

July 1999

Summary: Provides a guide to revising code that uses Microsoft® Data Access Objects (DAO) into code that uses Microsoft ActiveX® Data Objects (ADO), as well as a guide to writing new code using ADO with the Microsoft Jet Provider. (199 printed pages) Includes a discussion on the general differences between DAO and ADO and looks at some of the advantages to using ADO over DAO.

Click here to download the sample files associated with this article.

Contents

Introduction
General Differences
     ADO: Data Manipulation
     ADOX: Data Definition Security
     JRO: Replication
Getting Started
Opening a Database
     Microsoft Jet Databases
     Setting Microsoft Jet Options
     Secured Microsoft Jet Databases
     External Databases
     The Current Microsoft Access Database
Retrieving and Modifying Data
     Opening a Recordset
     Navigating Within a Recordset
     Finding Records in a Recordset
     Filtering and Sorting Data in a Recordset
     Updating Data in a Recordset
     Executing Queries
Defining and Retrieving a Database's Schema
     Creating a Database
     Retrieving Schema Information
     Creating and Modifying Tables
     Creating an Index
     Defining Keys and Relationships
     Creating and Modifying Queries
Security
     Changing a Password
     Creating Users and Groups
     Adding a User to a Group
     Setting Permissions
     Determining an Object's Owner
Replication
     Making a Database Replicable
     Making Objects Local or Replicable
     Creating a Replica
     Creating a Partial Replica
     Listing Filters
     Synchronizing Data
     Listing Synchronization Conflict Tables
Miscellaneous
     Handling Errors
     Using Transactions
     Compacting a Database
     Refreshing the Cache
New Features in ADO, ADOX, and JRO
     Creatable Recordset Objects
     Microsoft Data Links
     User Roster
     Enhanced Auto-Increment (Counter) Columns
     Replication
Obsolete Properties and Methods
Conclusion
Appendix A: DAO to ADO Quick Reference
Appendix B: Microsoft Jet 4.0 OLE DB Properties Reference
     ADO Connection Properties
     ADO Recordset Properties
     ADOX Table Properties
     ADOX Column Properties
     ADOX Index Properties
Appendix C: Microsoft Jet 4.0 OLE DB Provider-Defined Property Values
Appendix D: Microsoft Jet 4.0 ANSI Reserved Words