PROVIDER: OLE DB Provider Templates Sample

Click to open or copy the PROVIDER project files.

PROVIDER demonstrates an OLE DB provider that has more than one result set type. The OLE DB Provider wizard generates a provider that has a single result set based on a Win32 directory entry. This sample demonstrates how to enhance this functionality to include a Win32 registry entry.

The important classes in the sample are CDirRowset, CWindowsFile, CRegRowset, and CWinRegKey. Both CDirRowset and CRegRowset have a method Execute.\ that populates the result set. The result set acquires its shape from the data class. The data classes in this example (CWindowsFile and CWinRegKey) both contain PROVIDER_COLUMN_MAPs that determines what data will be returned to the user when the user requests a rowset. The file Rowset.cpp has an implementation for ICommand::Execute. The implementation of this function determines if a particular command text is prefixed by REG:. If it has such a prefix, it uses CRowsetImpl::CreateRowset to create a rowset that contains registry key information (CRegRowset); otherwise, it creates the standard wizard generated (CDirRowset).

For more information, see Using the OLE DB Provider Templates.