CCeDBDatabase::SeekValueSmaller

This method searches for the record for which the value of the specified property is smaller than 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 SeekValueSmaller( 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 the record having the largest value that is smaller 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 NAME as its application-defined identifier. If you pass in a property with an identifier of NAME, and a value of "Jones", this method returns the record for which the string value of the NAME property evaluates to less than Jones, but to greater than any other name in the database whose string value is also less than "Jones". If multiple records satisfy the criteria — for example, if there are two "Jacksons" 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, SeekValueSmaller 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, SeekValueSmaller seeks a greater value than Prop.

This method never sets the m_bEOF data member to TRUE.

See Also

CCeDBDatabase::SeekValueGreater, GetLastError