Microsoft Corporation
May 1998
This article discusses how to take advantage of Microsoft® ActiveX® Data Objects (ADO) with Microsoft® Visual Basic® version 5.0. ADO 2.0 has been integrated into Visual Basic 6.0. See the Visual Basic documentation for more information.
ActiveX Data Objects is a programming model, which means that it is not dependent upon any given back-end engine. ADO can access data through any OLE DB provider. The following OLE DB providers ship with Microsoft Data Access Components (MDAC) 2.0:
ODBC drivers are supported through the OLE DB Provider for ODBC, often referred to as Kagera.
The ADO object model consists of seven objects:
ADOR is a subset of this ADO object model. ADOR provides only the Recordset and Field objects.
With Visual Basic 6.0, ADO installs automatically. If you wish to use ADO 2.0 with a version of Visual Basic earlier than 6.0, you must follow these instructions:
If you include references to both ADO and DAO in the same project, you will have some difficulty. Both use the same object named Recordset, so the following code is ambiguous:
Dim r as recordset
To specify which object model to use, include a qualifier in front:
Dim s As ADODB.Recordset
Dim t As DAO.Recordset
For more information, see the Microsoft Knowledge Base article Q168342 "INFO: Choosing the Right VB5 Data Access Interface (ADO/DAO/RDO)."