The methods in IRowsetChange are used to update the values of columns in existing rows, delete existing rows, and insert new rows.
IRowsetChange requires IAccessor and IRowset.
Rowsets implement IRowsetChange if they support updating, deleting, or inserting rows. They are not required to support all three, but must support at least one of these operations to support IRowsetChange. The rowset reports which operations it supports through the DBPROP_UPDATABILITY property.
The consumer calls methods in IRowsetChange to modify rows as follows.
SetData and InsertRow require the use of an accessor. For more information about accessors, see "Accessors" in Chapter 6.
SetData and InsertRow can fail for a number of reasons. The most common of these is that new data values do not meet the schema or integrity constraints of the column. Furthermore, rowsets can have row-by-row and column-by-column access permissions that override the general permissions of the table or column. For more information, see the DBPROP_COLUMNRESTRICT and DBPROP_ROWRESTRICT properties "Rowset Properties" in Appendix C.
If IRowsetUpdate is exposed on the rowset, then changes made through IRowsetChange are buffered in the rowset and not transmitted to the data source until IRowsetUpdate::Update is called; this is known as delayed update mode. If IRowsetUpdate is not exposed on the rowset, then changes made through IRowsetChange are immediately transmitted to the data source; this is known as immediate update mode. For more information, see "Changing Data" in Chapter 5.
Method | Description |
DeleteRows | Deletes rows. |
InsertRow | Creates and initializes a new row. |
SetData | Sets data in one or more columns in a row. |