IRowPosition::SetRowPosition

Sets the current row position to a new hRow.

HRESULT SetRowPosition (
HCHAPTER      hChapter,
HROW         hRow,
DBPOSITIONFLAGS   dwPositionFlags);

Parameters

hChapter [in]

The chapter associated with the current row, or DB_NULL_HCHAPTER if the rowset is not chaptered.

hRow [in]

The new current row.

dwPositionFlags [in]

A flag indicating additional information about the new row position.

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

S_OK

The method succeeded.

E_FAIL

A provider-specific error occurred.

DB_E_CANCELED

The operation was canceled by a client during notification. If the current row position cannot be reset, then the current row will be set to DB_NULL_ROW with a position flag indicating DBPOSITION_NOROW.

E_UNEXPECTED

SetRowPosition was called without first calling ClearRowPosition.

Comments

SetRowPosition must always be called immediately following ClearRowPosition.

SetRowPosition fires the following notification phases with either DBREASON_ROWPOSITION_CHANGED or DBREASON_ROWPOSITION_CHAPTERCHANGED:

The RowPostion object maintains a reference count on the hRow by calling AddRefRows for the hRow when SetRowPosition is called.