Share via


Querying with Visual C++

Note

Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.

 

With Visual C++, the OLE DB Helper API, and optionally the OLE DB Provider API, you can construct, execute, and retrieve the results of queries.

The Simple Sample (QSample) illustrates use of the OLE DB Helper API and the OLE DB Provider API to construct and execute a query with Indexing Service. Using the OLE DB Helper API simplifies construction of a command tree for a query. The Simple Sample uses the CIMakeICommand, CITextToFullTreeEx, LocateCatalogs, and CIState functions in addition to the ICommandTree, ICommand, IAccessor, and IRowset interfaces. For more complex examples that use the OLE DB Provider exclusively and that require using a data source object and a session object to construct a command tree, see the AdvQuery Sample.

The following topics discuss selected code segments for the Simple Sample (from the QSample.cxx file) that perform actions specific to Indexing Service. For instructions about how to install the complete code of the Simple Sample, refer to Installing the Samples.