Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 1 (10.1)

Part Number B10119-01
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Master Index
Master Index
Go to Feedback page

MovePrev Method

Applies To




This method changes the current record to be the previous record in the dynaset's result set.


oresult OBinder::MovePrev(void)

oresult ODynaset::MovePrev(oboolean gopast = TRUE)


TRUE when we allow the current record mark to go before the first record in the set

This method sets the current record of the dynaset (for OBinder, the dynaset being managed by the OBinder object) to be the previous record in the result set.

It is possible to MovePrev before the first record in the dynaset. The current record then becomes invalid and the IsBOF method returns TRUE. This is the default behavior. If you want to restrict dynaset navigation to valid records, pass in a gopast argument of FALSE. OBinder::MovePrev always restricts navigation to valid records.

Execution of this method sends OADVISE_MOVE_PREV messages to all attached advisories. One of the advisories could cancel the move, which would result in an OFAILURE return.

If the dynaset is being managed by an OBinder object, this method causes PreMove and PostMove triggers to be called.

Return Value

An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).


This example traverses a dynaset record set from the last record to the first.

// open a database

ODatabase odb("ExampleDB", "scott", "tiger");

// construct and open the ODynaset

ODynaset odyn(odb, "select * from emp order by empno");

// go to the end


// and go through all the records

while (!odyn.IsBOF())


// process the record

// go to the previous record