Mark
2008-07-10 08:36:19 UTC
Using Delphi 2006, MySQL 5 and Corelab DBExpress drivers.
My keyfield has the following data:
99999
B 99999
B-99999
B99999
This is in the correct sorting order. My "search value" is B21600, which
means I need the B99999 record.
My first attempt was using GotoNearest, which should give me the correct
record. To my surprise it gives B-99999 as found record.
Ok, next try. Let's use a filter: "search value" <= "keyvalue", so B21600 <
keyfield. This should give a record count of 1 based on my list, because
only the last record is true. But no, recordcount is 2 and the first record
in the set is again the B-99999 record.
I tried this with both a TSimpleDataset and a
TSQLTable-TDataSetProvider-TClientDataSet combination. With the
poRetainServerOrder property set to true and to false. But all give the same
result.
What am I missing here ? It all works correct if I leave out the B-99999
record.
The work around is of course looping through the table and search for the
record myself, but I rather would use something like GotoNearest...
Is this Delphi related or driver related ?
My keyfield has the following data:
99999
B 99999
B-99999
B99999
This is in the correct sorting order. My "search value" is B21600, which
means I need the B99999 record.
My first attempt was using GotoNearest, which should give me the correct
record. To my surprise it gives B-99999 as found record.
Ok, next try. Let's use a filter: "search value" <= "keyvalue", so B21600 <
keyfield. This should give a record count of 1 based on my list, because
only the last record is true. But no, recordcount is 2 and the first record
in the set is again the B-99999 record.
I tried this with both a TSimpleDataset and a
TSQLTable-TDataSetProvider-TClientDataSet combination. With the
poRetainServerOrder property set to true and to false. But all give the same
result.
What am I missing here ? It all works correct if I leave out the B-99999
record.
The work around is of course looping through the table and search for the
record myself, but I rather would use something like GotoNearest...
Is this Delphi related or driver related ?