Microsoft KB Archive/185033

From BetaArchive Wiki

Article ID: 185033

Article Last Modified on 3/2/2005


  • Microsoft ActiveX Data Objects 1.0
  • Microsoft ActiveX Data Objects 1.5
  • Microsoft ActiveX Data Objects 2.0
  • Microsoft ActiveX Data Objects 2.1 Service Pack 2
  • Microsoft ActiveX Data Objects 2.5

This article was previously published under Q185033


Adoacc.exe is a self-extracting compressed file containing sample code that demonstrates how to use ActiveX Data Objects (ADO) with Microsoft Access 97. The sample code may be converted to use Microsoft Access 2000.


The following file is available for download from the Microsoft Download Center:

NOTE: Microsoft Technical Support does not support the use of ADO version 1.x within Microsoft Access 97. This sample is provided purely for informational purposes. Furthermore, this does not demonstrate or reference any OLE DB Provider for Jet. The access to ADO is being done via the OLE DB Provider for ODBC Drivers.

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

About the ADOACC Sample

The sample Adoacc.mdb database contains four ADO procedures/functions that accomplish the following:

  • Open a parameterized query against a Microsoft Access database.
  • Expose Dynamic and built-in properties for each ADO object that supports them.
  • Provide a code template (and helper functions) required for minimal handling of errors raised either by the underlying data provider or from ADO itself.
  • Create and execute a Stored Procedure against SQL Server that returns a result set as well as an output and return parameters. (This sample is written for the SQL Server ODBC Driver shipping with ODBC 3.x, which requires you to close the recordset before retrieving the output and return parameters.)

NOTE: The OLE DB provider for ODBC must be installed on the computer that runs the Adoacc.mdb file. The provider is available as part of the Microsoft Data Access Components (MDAC). The most current version of the MDAC components can be downloaded from:

The structure of the ADO Samples is standardized so that methods, functions and procedures share the same name. Often the layout of comments and whitespace is the same. This allows you to use the WinDiff utility included with both Microsoft Visual C++ and the Microsoft Platform SDK, to compare individual files, or even entire directories.

Key module names have been used in each version of the sample to aid in this comparison:

  • ADOCORE: Contains the event handlers for the four separate routines that demonstrate using ADO. (This is not in the Microsoft Access 97 sample. The code in question resides behind the main form.)
  • ADOUTILS: Contains helper routines for error handling, or for code shared by more than one of the ADO event handlers. (Present in the Microsoft Access 97 sample.)
  • LOG: Where necessary, contains advanced exception handling code (for C++ and Java in particular). Visual Basic, Visual Basic for Applications and VBScript do not have a need for this kind of extended error handling.NOTES: You should replace the Reference to Microsoft ActiveX Data Objects 2.0 Library with a Reference to the latest version of Microsoft ActiveX Data Objects Library.


For additional information, please see the following Web site:

About the ADO* Series of Samples

This is one of several identical samples implemented using ADO within various products, as listed below. The advantage is that these articles have an identical interface/functionality, demonstrating both the similarities and differences in using ADO with different languages and environments.

QNumber and Title

172403 FILE: Adovb.exe Demonstrates How to Use ADO with Visual Basic

220152 Sample: ADOVC1 Simple ADO/VC++ Application

Additional query words: ADOACC

Keywords: kbinfo kbdatabase kbfile kbmdacnosweep KB185033