Move Method

See Also      Applies To

Moves the position of the current record in a CdbRecordset object.

Syntax

VOIDMove( LONG lRows, CdbBookmark * bm = NULL );

Parameters

Type Argument Description
LONG lRows A signed value specifying the number of rows the position will move. If rows is greater than 0, the position is moved forward (toward the end of the file). If rows is less than 0, the position is moved backward (toward the beginning of the file).
CdbBookmark * bm Pointer to a bookmark. If specified, Move begins relative to this bookmark. If not specified (that is, the default value of NULL is used), Move begins from the current record.

Remarks

If you use Move to position the current record pointer before the first record, the current record pointer moves to the beginning of the file. If the CdbRecordset contains no records and its BOF property is True, using this method to move backward causes an error.

If you use Move to position the current record pointer after the last record, the current record pointer position moves to the end of the file. If the CdbRecordset contains no records and its EOF property is True, then using this method to move forward causes an error.

If either the BOF or EOF property is True and you attempt to use the Move method without a valid bookmark, a run-time error occurs.

Notes

Usage

#include <afxole.h>
#include <dbdao.h>

CdbBookmark bm;
...
recordset.Move( 10 );         // Move forward 10 records.
recordset.Move( -5, &bm );   // Move back 5 records relative to 
                           // a given bookmark.