CCeDBDatabase::SeekValueGreater

This method searches for a record in the database for which the value of the specified property is greater than or equal to the value of the property passed in the Prop parameter. This method positions the read/write pointer at the record's location.

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 SeekValueGreater( CCeDBProp& Prop );

Parameters

Prop
Property whose value is to be compared with the values of all properties in the database of the same type.

Return Values

The object identifier of a record having either the same value as Prop, or having the smallest value that is greater than the value of Prop, for the same type of property (as specified by the application-defined identifier of Prop). Zero if the seek operation fails; call GetLastError to determine why the operation failed.

Remarks

Assume you have a database in which one of the properties has the enumerated constant AGE as its application-defined identifier. If you pass in a property with an identifier is AGE, and a value of 39, this method returns the record with an AGE property that is either equal to 39, or greater than 39, but less than any other AGE in the database that is also greater than 39. If multiple records satisfy the criteria — for example, if there are two 40s in the database — this method returns whichever record comes first in the current sort order of the database.

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. If the property for which you are seeking does not have a sort order defined for it, SeekValueGreater fails, regardless of whether the record being sought actually exists in the database.

If you have set up the database to sort items in descending order, for instance by assigning a value of CCeDBProp::Sort_Descending to the CCeDBProp::SetSortFlags method then SeekValueGreater and SeekValueSmaller switch roles. In other words, SeekValueGreater seeks a smaller value than Prop.

This method never sets the m_bEOF data member to UE.

See Also

CCeDBDatabase::SeekValueSmaller, GetLastError