Platform SDK: Exchange 2000 Server

About the IDataSource Interface

[This is preliminary documentation and subject to change.]

The CDO object model defines the core IDataSource interface for accessing data within other ADO, CDO, and ADSI objects, or as persisted data in the Web Store. All top level CDO objects expose an implementation of this interface.

CDO objects are bound to items in the Web Store using the IDataSource.Open, IDataSource.SaveTo, and IDataSource.SaveToContainer methods. The Open method first binds the specified store item, identified by a Uniform Resource Locator (URL), and then copies the data into the object. The SaveTo method first binds the item, and then saves the current data stored within the CDO object into the store item. The SaveToContainer method is similar to SaveTo, except that you need only specify the folder (container) in which to save the item; the actual name for the item is an internally generated globally unique identifier.

CDO objects all provide the ability to bind other CDO, ADO, and ADSI objects. What types of objects a certain CDO can bind to is not part of the core IDataSource interface definition, but is left to the particular implementation. Object binding follows a similar pattern to Web Store item binding. The OpenObject method first binds the target object and then copies the data within the target object into the opening CDO object. Similarly, the SaveToObject first binds the object and then saves the data within the binding CDO object into the target object.

[diagram here]

CDO Object   <----- OpenObject ------- Target
CDO Object   -------SaveToObject ----> Target

Once a CDO object has been bound to a Web Store item or another object, changes made within the CDO object can be saved into the bound data source.