Platform SDK: Exchange 2000 Server

Updating Items in the Web Store

[This is preliminary documentation and subject to change.]

There are operational differences between CDO and ADO when updating items in the Web Store. First, we examine the procedures used to update items when using ADO, and then examine the procedure used with CDO. Finally, the differences are highlighted.

When you access an item in the Web Store using an ADO Record or Recordset object, a copy of the requested properties is copied into the ADO object. If you decide to make changes to the item's properties, you first alter, append or delete the values using the associated Fields collection, and then save these changes back to the store using the Fields.Update method. To recopy the values stored in the store back into the ADO object, you use the Fields.Resync method. If the item has an associated stream, you make changes to it by first retrieving it from the Fields collection using the special ADO index value of -1. The value of this Field is a reference to an ADO Stream object. After modifying the content within the Stream object, you call _Stream.Flush to commit the changes into the store. The important thing to remember is that there is no inherent correlation between the stream and the properties; both are treated as separate data values for the item.

CDO objects that modify items with streams, on the other hand, do maintain a correlation between the stream and the item's properties. Because of this correlation, modifications to the CDO object's Fields collection are not committed directly to the store when the Fields.Update method is called. Instead, you must invoke the IDataSource.Save method to commit the changes. When the Save call is executed, the item's stream is recreated and saved to the store along with the property values.