CDaoRecordset::FindNext

BOOL FindNext( LPCTSTR lpszFilter );
throw( CDaoException, CMemoryException );

Return Value

Nonzero if matching records are found, otherwise 0.

Parameters

lpszFilter

A string expression (like the WHERE clause in an SQL statement without the word WHERE) used to locate the record.

Remarks

Call this member function to find the next record that matches a specified condition. The FindNext member function begins its search at the current record and searches to the end of the recordset.

If you want to include all the records in your search (not just those that meet a specific condition) use one of the Move operations to move from record to record. To locate a record in a table-type recordset, call the Seek member function.

If a record matching the criteria is not located, the current record pointer is undetermined, and FindNext returns zero. If the recordset contains more than one record that satisfies the criteria, FindFirst locates the first occurrence, FindNext locates the next occurrence, and so on.

Caution   If you edit the current record, be sure you save the changes by calling the Update member function before you move to another record. If you move to another record without updating, your changes are lost without warning.

Using one of the Find operations is not the same as calling MoveFirst or MoveNext, however, which simply makes the first or next record current without specifying a condition. You can follow a Find operation with a Move operation.

Keep the following in mind when using the Find operations:

For more information about finding records, see the article DAO Recordset: Recordset Navigation in Visual C++ Programmer's Guide. For related information, see the topic "FindFirst, FindLast, FindNext, FindPrevious Methods" in DAO Help.

CDaoRecordset OverviewClass MembersHierarchy Chart

See Also   CDaoRecordset::Find, CDaoRecordset::FindFirst, CDaoRecordset::FindLast, CDaoRecordset::FindPrev