Update Functionality

To send updates and retrieve updated information, the Cursor Service keeps track of synchronization information. Upon rowset creation, the Cursor Service will attempt to obtain a pointer to the session object from which the rowset was created. Subsequently, the cursor's session can be set to a new value or set to null to disconnect the rowset.

The Cursor Service attempts to retrieve necessary metadata information from the cursor's IColumnsRowset interface. If necessary, the provider obtains additional extended metadata information through implementation-specific means and saves it to the rowset's IColumnsRowset interface for future use?in this case, for the update request.

Requested updates are handled using the IRowsetUpdate interface. When the Cursor Service's IRowsetUpdate::Update method is called, the session object is identified and row handles are passed to IRowsetUpdate::Update. The provider determines the changes to be made to each row and the data to be used for optimistic-searched updates.

The provider submits updates to the data store. For rows successfully updated, the underlying values are set, as is the status to DBROWSTATUS_S_OK, or to DBROWSTATUS_E_DELETED for deleted rows. For rows not successfully updated, the service passes DBROWSTATUS_S_NOCHANGE to prevent a change of the row status but still sets the underlying value.

The Cursor Service updates its internal values. For any rows whose status is DBROWSTATUS_S_OK, the rowset discards any pending changes and updates its original values. For any rows whose status is DBROWSTATUS_E_DELETED, it deletes the row from its caches.

See Also

Reference

IColumnsRowset

IRowsetUpdate::Update

Session Objects (OLE DB)