Using the ADSI OLE DB Provider for Searches

Under the OLE DB implementation, a directory service is exposed as a Data Source Object. Data source objects are factories for session objects and support IDBInitialize to connect to the directory, IDBCreateSession to create the session object, IDBProperties to supply authentication information to the underlying namespace and supply the query command and IPersist to save the information necessary to create the data source object to the underlying directory service.

The OLE DB Sessions Object represents a transaction on the data source object and, in the ADSI implementation, can create rowset objects and command objects. It supports IOpenRowSet to allow direct access to DS tables without having to use command objects. ISessionProperties to manage the information stored in property sets, and IDBCreateCommand to create a command object.

The OLE DB Command Object manages the information required by a search. The object supports the following interfaces:

The OLE DB Rowset Object allows the DS to expose its information in tabular form. The ADSI implementation of this object supports the following interfaces:

For more information about OLE DB, see the Database and Messaging Services section of the Microsoft Platform SDK.

To see if a specific provider implements these interfaces, see ADSI System Providers.

The ADSI SDK includes adsqry source code in the sampapp\cxx\adsqry directory. For an edited version of this example, see ADSI OLE DB Example.