Connecting to Microsoft Access with ADO - Overview of ActiveX Data Objects
(Page 2 of 6 )
Each version of ADO gains a few new features. This tutorial gives the most essential items needed for the current discussions. Starting with ADO 2.5, the ADO object model consists of five separate parts, each of which concentrates on a single issue. The five objects of this model are the Connection, Command, Recordset, Record and the Stream. The last of these gives access to data stored on a local machine. In the next couple of tutorials I will be exploring each of these objects in greater detail, providing concrete and full examples of their usage.
The next picture shows the ADO object model. In terms of the number of objects, this model is very superior to the DAO of a bygone era. It could not get simpler than this. Think of collections, and the individual items in the collection, and you are already halfway into the guts of the object. In this tutorial I will be concentrating on the Connection, because everything else starts after the connection.

The tutorial steps
We will be following step-by-step the line items shown here for this tutorial. Well, although you will be opening and closing a connection, the correct order is to open a connection, open a record set, use the recordset for some purpose, close the recordset, and close the connection. We will not discuss the use of recordset in this tutorial; we'll cover it in part two.. The summary of steps you will be following are as follows.
- Create a UDL file to connect to an MDB file.
- Read the connection string from the file.
- Create a MDB file, add a form, a button, and so on.
- Establish a reference to ADO.
- Write code to open and close the ADODB connection to the database.
- Review some connection properties using code.
Next: Create a UDL file to connect to an MDB file >>
More Microsoft Access Articles
More By Jayaram Krishnaswamy