CCeDBDatabase::SeekFirstEqual

This member function 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.

Syntax

CEOID SeekFirstEqual( CCeDBProp& Prop );

At a Glance

Header file: Wcedb.h
Platforms:
Versions: 2.0 and later

Parameters

Prop
A property having 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. Call ::GetLastError to determine why the operation failed.

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 function 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 function.

This function never sets the m_bEOF data member to TRUE.

See Also

CCeDBDatabase Overview, CCeDBDatabase Member Functions, Windows CE Database Classes, CCeDBDatabase::SeekFirst, CCeDBDatabase::SeekNextEqual, ::GetLastError