IDataSource

IDataSource is implemented by the data source object. By setting the DataSource property, a data consumer has access to the data source’s IDataSource interface and can ask for a data access interface.

When the data consumer asks for data, it specifies which data access interface it wants via an IID. Here are some examples:

If the consumer asks for IID_IUnknown, the data source should return the most appropriate interface for it.

When the data source is hosted in a container, and the container is setting up the bindings on behalf of the user, the container can be “smart” when obtaining the data access interface. It can intervene and provide mappings if the data consumer requires an interface that the data source does not implement. 

When the bindings are set in script, however, the container cannot intervene, so the user must supply the mapping manually by creating a data source adapter object.

Data members are sets of data and are identified by strings (BSTRs).

Method Description
getDataMember Returns a data access object (such as a row position) for a given data member.
getDataMemberCount Returns the number of well-known data members.
getDataMemberName Returns the name of a well-known data member.
addDataSourceListener Adds a listener to the notification list.
removeDataSourceListener Removes a listener from the notification list.