Поделиться через


CRecordView::OnMove

Call this member function to move to a different record in the recordset and display its fields in the controls of the record view.

virtual BOOL OnMove(
   UINT nIDMoveCommand 
);

Параметры

  • nIDMoveCommand
    One of the following standard command ID values:

    • ID_RECORD_FIRST   Move to the first record in the recordset.

    • ID_RECORD_LAST   Move to the last record in the recordset.

    • ID_RECORD_NEXT   Move to the next record in the recordset.

    • ID_RECORD_PREV   Move to the previous record in the recordset.

Возвращаемое значение

Nonzero if the move was successful; otherwise 0 if the move request was denied.

Заметки

The default implementation calls the appropriate Move member function of the CRecordset object associated with the record view.

By default, OnMove updates the current record on the data source if the user has changed it in the record view.

The Application Wizard creates a menu resource with First Record, Last Record, Next Record, and Previous Record menu items. If you select the Dockable Toolbar option, the Application Wizard also creates a toolbar with buttons corresponding to these commands.

If you move past the last record in the recordset, the record view continues to display the last record. If you move backward past the first record, the record view continues to display the first record.

Предупреждающее замечаниеВнимание!

Calling OnMove throws an exception if the recordset has no records. Call the appropriate user interface update handler function — OnUpdateRecordFirst, OnUpdateRecordLast, OnUpdateRecordNext, or OnUpdateRecordPrev — before the corresponding move operation to determine whether the recordset has any records.

Исключения

This method can throw exceptions of type CDBException*.

Требования

Header: afxdb.h

См. также

Основные понятия

CRecordView Class

CRecordView Members

Hierarchy Chart

CRecordset::Move