Data Sources and Binding
Topic Last Modified: 2007-11-09
The term data source is intended to be generic, meaning any object or store that can act as a repository of data. Examples of data sources include Collaboration Data Objects (CDO) objects, Microsoft® ActiveX® Data Objects (ADO) objects, Exchange store items, and Active Directory® directory service objects. The term binding refers to the state of two objects being associated, or linked, at run time. When you use an OLE DB provider to create or modify an item in the Exchange store, you first bind the object in the store, and then make changes to its properties or streams. After the data source is bound, the data in the data source can be modified, deleted, created, and so on.
After a binding has occurred, two copies of data are present: the data in the binding object (the binder), and the data source. For example, when you use an ADO Record object to bind to an existing item in the Exchange store, the data in the Record object is a copy of the data in the store. Similarly, when you use a CDO Message CoClass to bind to an ADO Record object, the data in the Record object is copied to the Message CoClass. When you make changes to the data in the binding object, these changes are not saved back to the data source automatically; you must commit the changes by using an appropriate method call.
Both ADO and CDO objects can bind to items in the Exchange store by using an appropriate OLE DB provider. Thus, both ADO and CDO objects can have Exchange store items as data sources. CDO objects, on the other hand, can have other objects as data sources. For example, a CDO Message CoClass can bind to an ADO Record object, an ADO Stream object, a CDO body part object, or any object that exposes an implementation of the IStream interface.
This section includes the following topic:
For more information about the IDataSource interface, see IDataSource Interface.