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


CRecordset::MoveFirst

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

void MoveFirst( );

Заметки

Regardless of whether bulk row fetching has been implemented, this will always be the first record in the recordset.

You do not have to call MoveFirst immediately after you open the recordset. At that time, the first record (if any) is automatically the current 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.

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

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.

ПримечаниеПримечание.

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.

Требования

Header: afxdb.h

См. также

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

CRecordset Class

CRecordset Members

Hierarchy Chart

CRecordset::Move

CRecordset::MoveLast

CRecordset::MoveNext

CRecordset::MovePrev

CRecordset::IsBOF

CRecordset::IsEOF