Accessing OLE DB with the OLE DB Provider for Indexing Service
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.
This section includes information on how to access OLE DB through the OLE DB Provider for Indexing Service.
Indexing Service supports command-tree extensions for OLE DB, which are a part of OLE DB 2.5. To enable command-tree definitions in Oledb.h, define the constant OLEDBVER in program source files before including Oledb.h:
#define OLEDBVER 0x250
For more information on property sets supported by this provider, see Property Sets and Property Groups.
The OLE DB provider for Indexing Service provides read-only access to the content and property indexes created by the indexing process. Clients of Indexing Service are OLE DB consumers of the Indexing Service data source object (DSO) that represents the content and property indexes.
The class identifier (CLSID) for the Indexing Service DSO is CLSID_INDEX_SERVER_DSO. Consumers use the CLSID to create instances of provider DSOs that expose the initialization interfaces that allow the consumers to connect to the underlying Indexing Service indexes.
The following example illustrates this.
#include "Ntquery.h"
IDBInitialize *pIDBInit;
HRESULT hr;
hr = CoCreateInstance( CLSID_INDEX_SERVER_DSO,
0,
CLSCTX_INPROC_SERVER,
IID_IDBInitialize,
(void **) &pIDBInit );
If (FAILED(hr))
(
// Display error
)