Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


Makes the first record in the previous rowset the current record.

void MovePrev( );

If you have not implemented bulk row fetching, your recordset has a rowset size of 1, so MovePrev simply moves to the previous record.


This member function is not valid for forward-only recordsets.


When you move through a recordset, you cannot skip deleted records. See the IsDeleted member function for details.

Caution noteCaution

Calling any of the Move functions throws an exception if the recordset has no records. To determine whether the recordset has any records, call IsBOF and IsEOF.


It is also recommended that you call IsBOF before calling MovePrev. For example, if you have scrolled ahead of the beginning of the recordset, IsBOF will return nonzero; a subsequent call to MovePrev would throw an exception.


If you call any of the Move functions while the current record is being updated or added, the updates are lost without warning.

For more information about recordset navigation, see the articles Recordset: Scrolling (ODBC) and Recordset: Bookmarks and Absolute Positions (ODBC). For more information about bulk row fetching, see the article Recordset: Fetching Records in Bulk (ODBC).

This method can throw exceptions of type CDBException* and CMemoryException*.

See the example for IsBOF.

© 2016 Microsoft