The IRowsetChange interface is used to update a rowset. Changes may take place immediately or be delayed, depending on whether IRowsetUpdate is exposed by the rowset. For more information, see the OLE DB Programmer’s Reference, Chapter 5, “Updating Data in Rowsets.”
Setting data is similar to getting data: The consumer must have a row handle, an accessor handle, and a buffer. The accessor handle describes which columns are being set, and the buffer contains the data. IRowsetChange::SetData is the method used to set data values in a row. CRowset::SetData simply uses IRowsetChange::SetData.
IRowsetChange::DeleteRows is used to delete rows from a rowset. Callers are encouraged to supply a DBROWSTATUS array and inspect the row status after deleting the rows. CRowset::DeleteRows is equivalent to IRowsetChange::DeleteRows.
Inserting a row is simple to do using IRowsetChange::InsertRow. The provider initializes the inserted row based on the binding information defined by the accessor handle argument. If the accessor was created with binding information, then pData must be a valid data buffer. If you have a null accessor—one that was created with no binding information—then pData is ignored and the row is created with default column values. CRowset:: InsertRow is equivalent to IRowsetChange:: InsertRow.
Rowsets expose IRowsetUpdate when changes made through IRowsetChange are buffered until IRowsetUpdate::Update is called. Consumers can back out of changes made before IRowsetUpdate::Update is called by calling IRowsetUpdate::Undo. This is referred to as delayed updating (as opposed to immediate updating). CRowset provides wrappers for all IRowsetUpdate methods.