Adoacc.exe Demonstrates Using ADO with MS Access 97

ID: Q185033


The information in this article applies to:
  • ActiveX Data Objects (ADO), versions 1.0, 1.5, 2.0, 2.1 SP2


SUMMARY

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.


MORE INFORMATION

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:

ADOACC.EXE
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 more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

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:
http://microsoft.com/data
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.


REFERENCES

For additional information, please see the following Web site:

http://www.microsoft.com/data/

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

Q172403 FILE: Adovb.exe Demonstrates How to Use ADO with Visual Basic
Q220152 Sample: ADOVC1 Simple ADO/VC++ Application
Q182782 FILE: Adovj.exe Demonstrates How to Use ADO with Visual J++

Additional query words:

Keywords : kbfile kbAccess kbADO150 kbADO200 kbDatabase kbGrpVBDB kbGrpMDAC kbDSupport kbADO210sp2
Version : WINDOWS:1.0,1.5,2.0,2.1 SP2
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: November 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.