OLE DB Programmer's Reference |
Sets the current row position to a new hRow.
HRESULT SetRowPosition ( HCHAPTER hChapter, HROW hRow, DBPOSITIONFLAGS dwPositionFlags);
Parameters
Value | Meaning |
---|---|
DBPOSITION_OK | hRow specifies the current row position. |
DBPOSITION_NOROW | hRow is DB_NULL_ROW, and the current row position is undefined. |
DBPOSITION_BOF | hRow is DB_NULL_ROW, and the row position is before the beginning of the rowset. |
DBPOSITION_EOF | hRow is DB_NULL_ROW, and the row position is off the end of the rowset. |
Return Code
dwPositionFlags indicated DBPOSITION_OK, but hRow was an invalid value.
dwPositionFlags indicated DBPOSITION_NOROW, DBPOSITION_BOF, or DBPOSITION_EOF, and hRow was not set to DB_NULL_ROW.
There is no current rowset.
ITransaction::Commit or ITransaction::Abort was called, and the object is in a zombie state.
Comments
IRowPosition::ClearRowPosition must be called prior to the first and any subsequent IRowPosition::SetRowPosition calls.
IRowPosition::SetRowPosition fires the following notification phases with either DBREASON_ROWPOSITION_CHANGED or DBREASON_ROWPOSITION_CHAPTERCHANGED:
The row position object maintains a reference count on the both the hRow and the hChapter by respectively calling IRowset::AddRefRows for the hRow and IChapteredRowset::AddRefChapter for the hChapter when IRowPosition::SetRowPosition is called.
1998-2001 Microsoft Corporation. All rights reserved.