Providers choose the functionality that they support according to the native functionality of the data that they expose. However, in order to be consumed by generic consumers, providers must be able to meet at least the minimum consumer functionality defined above. The developer of the provider can achieve this functionality in one of three ways:
In addition, providers may expose interfaces for these sets of functionality: rowset processing, commands, and indexes.
All providers must be either apartment or free threaded, and must support aggregation of the DataSource, Session, Rowset, and (if applicable) Command and View objects.
Provider writers are strongly encouraged to implement the full set of interfaces that apply to their particular type of data. At a minimum, the following interfaces and behavior must be implemented in order to be considered a generic OLE DB provider. Providers implementing this minimum provider functionality can be aggregated by common service components available in the SDK in order to support the minimum consumer functionality.
Object | Interface Behavior |
DataSource | IDBCreateSession |
IDBInitialize | |
IDBProperties | |
IPersist | |
DataSource Behavior | DBPROP_INIT_PROMPT |
Session | IGetDataSource |
IOpenRowset | |
ISessionProperties | |
ITransactionLocal 3 | |
Rowset | IAccessor |
IConvertType | |
IColumnsInfo | |
IRowset | |
IRowsetChange 2 | |
IRowsetIdentity | |
IRowsetInfo | |
Rowset Behavior | DBPROP_CANHOLDROWS |
DBPROP_CANFETCHBACKWARDS | |
DBPROP_COMMITPRESERVE 3 | |
DBPROP_OWNUPDATEDELETE 2 | |
DBPROP_OWNINSERT 2 | |
DBPROP_REMOVEDELETED 2 |
(2) Minimal level of support for providers wanting to expose update capability. Providers not supporting this functionality are treated as read-only by generic consumers.
(3) Minimal level of support for providers wanting to support transactions to general consumers.
Providers that implement the full set of Level 1 interfaces can be consumed by general consumers without the support of additional service components. Providers that can fully implement this level of functionality are strongly encouraged to do so.
Providers implementing the following functionality in addition to the minimum provider functionality are consumed as full Level 1 providers.
Object | Interface Behavior |
DataSource | IConnectionPointContainer for: IDBAsynchNotify |
IDBAsynchStatus | |
ISupportErrorInfo | |
Rowset | IDBAsynchStatus |
IConnectionPointContainer for: IRowsetNotify, IDBAsynchNotify | |
IRowsetFind | |
IRowsetLocate | |
IRowsetScroll | |
ISupportErrorInfo | |
Rowset Properties | DBPROP_CANSCROLLBACKWARDS |
The following additional functionality may be supported by general-purpose providers. Providers are encouraged to support as much from this list as makes sense for their particular type of data.
Object | Interface Behavior |
DataSource | IDataSourceAdmin |
IPersistFile | |
Session | IDBSchemaRowset |
IDBView | |
ITableDefinition | |
ITransactionJoin 3 | |
ITransactionObject 3 | |
Rowset | IColumnsRowset |
IRowsetIdentity | |
IRowsetLocate | |
IRowsetResynch 2 | |
IRowsetUpdate 2 | |
Rowset Properites | DBPROP_ABORTPRESERVE 3 |
DBPROP_CHANGEINSERTEDROWS | |
DBPROP_LITERALBOOKMARKS | |
DBPROP_ORDEREDBOOKMARKS | |
DBPROP_LITERALIDENTITY | |
DBPROP_BOOKMARKSKIPPED | |
DBPROP_OTHERINSERT | |
DBPROP_OTHERUPDATEDELETE | |
DBPROP_RETURNPENDINGROWS | |
DBPROP_STRONGIDENTITY | |
DBPROP_IMMOBILEROWS | |
Blobs | DBPROP_OLEOBJECTS |
DBPROP_MULTIPLESTORAGEOBJECTS | |
DBPROP_STRUCTUREDSTORAGE | |
ISequentialStream | |
IStream | |
IStorage | |
ILockBytes | |
DBPROP_BLOCKINGSTORAGEOBJECTS=FALSE |
(2) Extended functionality that may be exposed by updatable providers.
(3) Extended functionality that may be exposed by transacted providers.
Providers that support filtering or sorting of data are encouraged to support the following rowset processing interfaces.
Object | Interface Behavior |
Session | IDBView |
View | IViewFilter |
IViewSort | |
IColumnsInfo | |
IAccessor | |
ISupportErrorInfo | |
IViewRowset | |
IViewChapter | |
Rowset | IChapteredRowset |
IRowsetView | |
IRowsetFind |
Providers that support more sophisticated query/statement execution support commands. In order to be a general provider of commands, the provider must support the following set of functionality in addition to the minimal provider functionality defined above.
Object | Interface Behavior |
DataSource | IDBInfo |
Session | IDBCreateCommand |
ITransactionLocal | |
Command | IAccessor |
ICommand | |
ICommandText | |
IColumnsInfo | |
ICommandProperties | |
ICommandWithParameters | |
IConvertType | |
ISupportErrorInfo | |
Command Properties | MAXTABLESINSELECT>1 (not true for consumer) |
Custom Error | ISQLErrorInfo |
The following set of extended command functionality may also be supported by command providers.
Object | Interface Behavior |
Session | ITransactionJoin |
ITransactionObject | |
Command | ICommandPrepare |
IColumnsRowset | |
Mult Results Object | IMultipleResults |
Rowset | IRowsetResynch |
Rowset Properties | DBPROP_CANSCROLLBACKWARDS |
Providers built on indexed data can expose index functionality to service providers such as query processors by implementing the following interfaces.
Object | Interface Behavior |
Session | IDBView |
Rowset | IRowsetIndex |
IIndexDefinition | |
IChapterRowset | |
IRowsetView | |
View | IViewFilter |
IViewSort | |
IColumnsInfo | |
IAccessor | |
ISupportErrorInfo | |
IViewRowset | |
IViewChapter |