CCeDBDatabase::SeekFirstEqual

This method searches for the first record in the database that has a property that matches the property passed in the Prop parameter. A matching property has the same application-defined identifier and the same value.

At a Glance

Header file: Wcedb.h
Platforms: H/PC 2.0, Palm-size PC, H/PC Pro
Windows CE versions: 2.0 and later

Syntax

CEOID SeekFirstEqual( CCeDBProp& Prop );

Parameters

Prop
Property that has the same application-defined identifier and value as the property for which to seek.

Return Values

The object identifier of the first record having the same value for the specified property, or zero if the seek operation fails. To get extended error information, call GetLastError.

Remarks

A CCeDBDatabase object can only do a search on a property for which a sort order has been defined. This means that the database must have a sort property associated with it that has the same application-defined identifier as the property you pass in the Prop parameter. The SeekFirstEqual method searches the database in the order specified by this sort property.

If the property for which you are seeking does not have a sort order defined for it, SeekFirstEqual will fail, regardless of whether the record being sought actually exists in the database. SeekFirstEqual will also fail if the record being sought is before the current read/write position. To prevent this, call SeekFirst before calling this method.

This method never sets the m_bEOF data member to TRUE.

See Also

CCeDBDatabase::SeekFirst, CCeDBDatabase::SeekNextEqual, GetLastError