Article ID: 184233 - Last Review: February 12, 2007 - Revision: 3.1 INFO: Using ActiveX Data Objects (ADO) Through Microsoft Access 97This article was previously published under Q184233 On This PageSUMMARY
This article discusses what is necessary to take advantage of ActiveX Data
Objects (ADO) with Microsoft Access 95 and 97. NOTE: Microsoft Technical Support does not provide support for ADO used in conjunction with Microsoft Access 95 and 97. This article is provided for informational purposes. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual. MORE INFORMATIONADO and Microsoft Access 95/97Both Microsoft Access 95 and 97 are built around the Jet database engine, whose functionality is exposed through Data Access Objects (DAO).While it is possible to use ADO within Microsoft Access 95 and 97 just as you would any other OLE Automation Server, Microsoft Access itself is optimized for Data Access through DAO. The only advantage of using ADO in lieu of DAO is when you request data through an OLE DB provider that does not have a corresponding ODBC Driver. Using ADO also allows you to access a greater variety of datastores than DAO since ODBC accesses relational data only. OLE DB exposes non-relational data to ADO, allowing you to access and manipulate more data sources using ADO/OLE DB than possible with DAO/ODBC. For example, the OLE DB Provider for Microsoft Index Server or the OLE DB Provider for Microsoft Active Directory allows you to access data through ADO. As ADO imposes no assumptions or restrictions on SQL Syntax, it offers an ideal object model for exposing data that otherwise would not be available to ODBC, and via ODBCDirect, Jet/DAO. Installing and Redistributing ADO with Microsoft AccessThe ActiveX Data Objects Library is available as part of the Microsoft Data Access Components (MDAC). MDAC includes ODBC, the OLE DB Provider for ODBC Drivers, ADO, the Remote Data Service, and various other ODBC Drivers. For more information on the MDAC Redistribution, please see the REFERENCES section.You can use the Setup Wizard included in the Microsoft Office 97 Developer Edition (ODE) to include and run the MDAC redistribution setup program. Running the MDAC redistribution program installs MDAC components to other computers. You must add the MDAC redistribution file to your application and then you may run it automatically using the options provided in the ODE Setup Wizard. Referencing the ADO Type Library
http://msdn.microsoft.com/dataaccess
(http://msdn.microsoft.com/dataaccess)
Single Versus Double Quotation Marks with ADOADO imposes no restrictions on the syntax used to generate a recordset or execute a statement. These restrictions come from the underlying native OLE DB provider, such as the OLE DB Provider for Index Server or the OLE DB Provider for ODBC Drivers.When you use the OLE DB Provider for ODBC Drivers, the ODBC driver itself defines valid SQL syntax for use with ADO. You must keep this in mind when migrating SQL syntax to ADO. The SQL statement below runs successfully when DAO is used to issue commands to the Jet database engine:
0x80040E10
-2147217904
Too few parameters. Expected 1.
Consider this example used to return data from the OLE DB Provider for Microsoft Index Server (that runs on a computer that has both Microsoft Index Server and Microsoft Internet Information Server installed): REFERENCES
For additional information on MDAC versions 2.0 and earlier, please refer to:
http://msdn.microsoft.com/library/techart/msdn_redistmdac.htm
(http://msdn.microsoft.com/library/techart/msdn_redistmdac.htm)
You may also download the MDAC components from the following World Wide Web
URL:
http://msdn.microsoft.com/dataaccess
(http://msdn.microsoft.com/dataaccess)
APPLIES TO
| Article Translations
|

Back to the top
