Data Source Objects

A provider initially creates an instance of a data source object when the consumer calls CoCreateInstance on the class ID for that provider. Consumers don't usually call CoCreateInstance directly, but instead bind to the file moniker of a persisted data source object or to a moniker returned by the enumerator object. The code that performs the binding calls CoCreateInstance on behalf of the consumer. It is important to distinguish the data source object from the data source, which actually contains the data. For example, a data source might be a text file, an SQL database, or an in-memory array in an application.

Data source objects:

CoType TDataSource {
   [mandatory] interface IDBCreateSession;
   [mandatory] interface IDBInitialize;
   [mandatory] interface IDBProperties;
   [mandatory] interface IPersist;
   [optional]  interface IConnectionPointContainer;
   [optional]  interface IDBAsynchStatus;
   [optional]  interface IDBDataSourceAdmin;
   [optional]  interface IDBInfo;
   [optional]  interface IPersistFile;
   [optional]  interface ISupportErrorInfo;
}

For information about the registry entries used by providers, which create instances of data source objects, see "Provider Registry Entries" in Chapter 14.