CDatabaseRecordset::FindRecord

[This is preliminary documentation and subject to change.]

The FindRecord method searches the recordset for a record that matches the specified type and search criteria.

long FindRecord(
  long FindType,    
  LPCTSTR Criteria  
);
 

Parameters

FindType
A flag that specifies the type of record to find. It can be any one of the following values.
Value Meaning
dbFindFirst Find the first record that matches the criteria.
dbFindLast Find the last record that matches the criteria.
dbFindNext Find the next record that matches the criteria.
dbFindPrevious Find the previous record that matches the criteria.

Criteria
A string that can be evaluated as a logical expression within the context of the recordset. For example, "Channel Number = 27".

Return Values

A long that specifies the 0-based index of the found record. If a match is not found, this method moves the record pointer to the first record, and returns -1.

Remarks

Opening a recordset using the OpenIndexed method and then using the Seek method to find records provides better performance than using the FindRecord method.

QuickInfo

  Windows NT: Unsupported.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in dbsets.h.
  Import Library: Use dbsets.lib or dbsetsSt.lib.
  Unicode: Yes.