FILE: Adovcbm.exe ADO 1.5 with #import and Getrows/Bookmarks

ID: Q182389

The information in this article applies to:

SUMMARY

The Adovcbm.exe sample demonstrates Bookmarks, recordset traversal, GetRows and other ActiveX Data Objects (ADO) Recordset methods using smart pointers and #import. Using #import is the preferred way for Visual C++ programmers to use ADO.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ Adovcbm.exe (size: 111977 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

It is not necessary to use the absolute path for the ADO .dll file. You can add the path to Visual Studio IDE from the Tools menu under Options. Select the Directory tab and add the path to the Library files list, which allows you to use the statement:

   #import "Msado15.dll" rename_namespace("ado15")

The database file Adostudent.mdb is included with the sample. The sample opens a database connection with a DSN-less ConnectionString, so you do not need to specify a data source name (DSN).

The function CrackStrVariant takes a variant and returns a CString. This function was copied in its entirety from the DAOVIEW sample that ships with Visual C++.

REFERENCES

For additional information on ADO recordset manipulation using UpdateBatch and CancelBatch, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q181733
   TITLE     : FILE: Adovcbtd.exe #import Using UpdateBatch and CancelBatch

Keywords          : kbfile 
Version           : WINDOWS:1.5
Platform          : WINDOWS
Issue type        : kbhowto

Last Reviewed: May 3, 1999