CdbRecordset::MoveFirst, MoveLast, MoveNext, MovePrevious Methods

Moves to the first, last, next, or previous record in a specified Recordset object and makes that record the current record.

Syntax

VOIDMoveFirst(VOID);

VOIDMoveLast(LONG lOptions=-1);

VOIDMoveNext(VOID);

VOIDMovePrevious(VOID);

Parameters

Type Example Description
LONG lOptions=-1 Optional. If set to the dbRunAsync constant, the method call is asynchronous. You can use the Cancel method to terminate execution of the asynchronous MoveLast method call. You can use the StillExecuting property to determine when the Recordset is fully populated.

Usage

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

CdbDatabase      dbs;
CdbRecordset      rst;
...                        // Initiliaze dbs, etc.
rst = dbs.OpenDatabase(strSQL);
while (!rst.GetEOF())                
{
   ...                  // Do some processing.
   rst.MoveNext();      // Get the next record.
}