dbMovePrevious()

Database function which moves the data record pointer to the previous record in the record set.

Synopsis

int dbMovePrevious(dbRecordset recordset);

Parameters

Parameter Meaning
recordset Record set reference

Return Value

The return value is an error code; 0 indicates the operation has been performed successfully. For other values dbGetError() can be used to obtain detailed error information.

Errors

An error is returned if an invalid record set reference variable is passed, or if positioning before the first data record in a record set.

Description

dbMovePrevious() is called in order to make the current record that record located in front of the current record in a record set. This method is only permitted for the cursor types adOpenKeyset, adOpenDynamic and adOpenStatic. The data source must allow backwards scrolling through the record set.

If the data record pointer is moved in front of the first data record in the record set using dbMoveFirst(), the data record pointer is undefined and an error is returned. Before calling another record set method, the record set must be closed and re-opened.

One should note that unconfirmed changes (i.e. data fields changed by dbPutField() without dbUpate()) are automatically saved in the data source by an (internal) dbUpdate() call when the data record pointer is changed.

Example

see dbMoveNext()

Assignment

ADO and Qt, Database functions

Availability

CTRL