SAMPLE: Seek.exe Demonstrates How to Use IRowsetIndex Methods Seek, SetRange, and GetIndexInfo (258580)



The information in this article applies to:

  • Microsoft OLE DB Provider for Jet 4.0

This article was previously published under Q258580

SUMMARY

Seek.exe is a sample that demonstrates how you can use the Seek(), SetRange(), and GetIndexInfo() methods of the IRowsetIndex interface. Note that this interface is currently only supported by the Jet 4.0 OLE DB provider when it is used with a Microsoft Access 2000 database, and will not work with an earlier version of Access.

To use this sample, you must install Microsoft Visual C++ 6.0 Service Pack 3 because the OLE DB headers that were included with previous versions did not define the IRowsetIndex interface.

This sample uses two accessors: an accessor that you can use with index searches, and another one to retrieve data from the Jet database. In your application, you can use the same accessor for index searching and data retrieval.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Release Date: May 24, 2000

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.
Seek.exe contains the following files:

FileSize
Accessor.h1 KB
MsJetOleDb.h12 KB
Seek.cpp11 KB
Seek.dsp5 KB
Seek.dsw1 KB
StdAfx.cpp1 KB
StdAfx.h1 KB


You can follow these steps to run this sample:
  1. Open the workspace file (Seek.dsw) in Microsoft Visual C++ 6.0 and compile it.
  2. This sample uses the NWIND.MDB (Northwind database) that is provided with Microsoft Access. Make sure that the format of this database is Access 2000. Modify the path for DBPROP_INIT_DATASOURCE in the function GetDataSourcePropSet() to point to your Northwind database.
  3. Compile and run the program to see a list of names in the console application.
NOTE: The debug version of this program will output any encountered messages to the output window.

REFERENCES

For additional information on how you can use the Seek method, click the article number below to view the article in the Microsoft Knowledge Base:

258576 Limitations of IRowsetIndex::Seek() Used with Jet database


Modification Type:MinorLast Reviewed:8/9/2004
Keywords:kbdownload kbDatabase kbfile kbJET kbProvider kbSample KB258580 kbAudDeveloper