IRowsetChange

OLE DB Programmer's Reference

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.

When to Implement

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.

To request updatability of the rowset, the consumer should set DBPROP_IRowsetChange to VARIANT_TRUE and specify the desired updatability in the DBPROP_UPDATABILITY rowset property when creating the rowset.

When to Call

The consumer calls methods in IRowsetChange to modify rows as follows.

  • IRowsetChange::SetData sets column data in an existing row.
  • IRowsetChange::DeleteRows deletes existing rows.
  • IRowsetChange::InsertRow creates a new row and sets initial values.

IRowsetChange::SetData and IRowsetChange::InsertRow require the use of an accessor. For more information about accessors, see "Accessors" in Chapter 6: Getting and Setting Data.

IRowsetChange::SetData and IRowsetChange::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 Property Group" in Appendix C.

If IRowsetUpdate is exposed on the rowset, changes made through IRowsetChange are buffered in the rowset and not transmitted to the data store until IRowsetUpdate::Update is called; this is known as delayed update mode. If IRowsetUpdate is not exposed on the rowset, changes made through IRowsetChange are immediately transmitted to the data store; this is known as immediate update mode. For more information, see "Changing Data" in Chapter 5: Updating Data in Rowsets.

Method Description
DeleteRows Deletes rows.
InsertRow Creates and initializes a new row.
SetData Sets data in one or more columns in a row.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net