LocateEx with lxNearest problem with dates

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Thu 03 Sep 2009 17:54

Thanks Dimon. The DbForge Fusion integrated into the IDE is great.

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Wed 09 Sep 2009 15:15

Dimon, going back to the lxNearest problem. In the CodeGear help for TTable FindNearest it states

FindNearest positions the cursor either on a record that exactly matches the search criteria, or on the first record whose values are greater than those specified in the search criteria. If there are no records that match or exceed the specified criteria, FindNearest positions the cursor on the last record in the table

Just to let you know that, if you search for a value that falls beyond the end of the table then LocateEx with TLocateExOptions set to lxNearest does not go to the last record.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 10 Sep 2009 08:22

In MyDAC help said:
lxNearest - LocateEx moves the cursor to a specific record in a dataset or to the first record in the dataset that is greater than the values specified in the KeyValues parameter. For this option to work correctly dataset should be sorted by the fields the search is performed in. If dataset is not sorted, the function may return a line that is not connected with the search condition.

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Thu 10 Sep 2009 08:54

OK Dimon, MyDAC help doesn't state it will move to the end of the table if the search value is greater than the last record but don't you think it should for consistency? If I'm searching on a string field (where the current record's value for this field is "AA") and I enter 'ZZ' as the search string, in what way is "AA" the 'nearest' when the last record alphabetically is "ZAK"?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 14 Sep 2009 11:26

OK. We have investigated this problem. In the next MyDAC build this behavior will be the same as in BDE.

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Mon 14 Sep 2009 11:34

Thanks Dimon.

Post Reply