Subject | Problem/Bug with Descending Incremental search? |
---|---|
Author | Mark Pickersgill |
Post date | 2003-12-15T11:15:35Z |
Hello,
just been playing around with basic incremental searching and
have noticed that if a descending order is used with a
TIB_IncSearch component with SearchKeyByKey and SeekNearest set
to true, the records that the dataset seeks to are incorrect.eg
you may have entered 'fr' into the Incremental search edit box,
but even though there is a record "FRESH", the dataset will
jump to something like "FISH".
I'm wondering if I'm doing something wrong or whether it's a bug?
Ascending incremental search works fine.
Here are some steps to reproduce the problem:
1) Setup test table:
CREATE TABLE TEST (CODE CHAR(6), DESCR VARCHAR(10));
INSERT INTO TEST (CODE) VALUES('FAL');
INSERT INTO TEST (CODE) VALUES('FALQ');
INSERT INTO TEST (CODE) VALUES('FANG');
INSERT INTO TEST (CODE) VALUES('FBM');
INSERT INTO TEST (CODE) VALUES('FFFV');
INSERT INTO TEST (CODE) VALUES('FIOO');
INSERT INTO TEST (CODE) VALUES('FISHSJ');
INSERT INTO TEST (CODE) VALUES('FITZ');
INSERT INTO TEST (CODE) VALUES('FITZ.');
INSERT INTO TEST (CODE) VALUES('FJOE');
INSERT INTO TEST (CODE) VALUES('FRSS');
INSERT INTO TEST (CODE) VALUES('FRUIBA');
INSERT INTO TEST (CODE) VALUES('FRUITX');
INSERT INTO TEST (CODE) VALUES('FSAP');
INSERT INTO TEST (CODE) VALUES('FULL');
INSERT INTO TEST (CODE) VALUES('FVOM');
INSERT INTO TEST (CODE) VALUES('FWFM');
COMMIT;
2) Create a new application
-Drop a TIB_Connection (name it con) and hook it up to a test database
-Drop a TIB_DataSource, TIB_Query (name it sql1) and hook them up (and
to the connection)
-Drop a TIB_Grid, TIB_IncSearch and set the Datasource property
-Set the SearchKeyByKey and SeekNearest properties on the
TIB_IncSearch component to TRUE.
3) Set the Query up (note, these were all setup in the component
editor)
-SQL:
SELECT CODE, DESCR FROM TEST
-OrderingItems:
CODE=CODE;CODE DESC
DESCR=DESCR;DESCR DESC
-OrderingLinks:
CODE=ITEM=1
DESCR=ITEM=2
-SearchingLinks
CODE=CODE
DESCR=DESCR
4) Place:
con.Connect;
sql1.Prepare;
sql1.Open;
into the FormCreate method.
5) Run app and click on the Grid heading until the order of the code
field is decending. Then type in "fr" into the incremental search
edit.
You should see that the record selected is not the correct one. (In my
case it was "FISHSJ")
Any suggestions?
Setup:
Delphi 5 (update pack 1)
IBObjects 4.3.Aa
Firebird 1.5rc7
Windows 2000 sp4
thanks
Mark
just been playing around with basic incremental searching and
have noticed that if a descending order is used with a
TIB_IncSearch component with SearchKeyByKey and SeekNearest set
to true, the records that the dataset seeks to are incorrect.eg
you may have entered 'fr' into the Incremental search edit box,
but even though there is a record "FRESH", the dataset will
jump to something like "FISH".
I'm wondering if I'm doing something wrong or whether it's a bug?
Ascending incremental search works fine.
Here are some steps to reproduce the problem:
1) Setup test table:
CREATE TABLE TEST (CODE CHAR(6), DESCR VARCHAR(10));
INSERT INTO TEST (CODE) VALUES('FAL');
INSERT INTO TEST (CODE) VALUES('FALQ');
INSERT INTO TEST (CODE) VALUES('FANG');
INSERT INTO TEST (CODE) VALUES('FBM');
INSERT INTO TEST (CODE) VALUES('FFFV');
INSERT INTO TEST (CODE) VALUES('FIOO');
INSERT INTO TEST (CODE) VALUES('FISHSJ');
INSERT INTO TEST (CODE) VALUES('FITZ');
INSERT INTO TEST (CODE) VALUES('FITZ.');
INSERT INTO TEST (CODE) VALUES('FJOE');
INSERT INTO TEST (CODE) VALUES('FRSS');
INSERT INTO TEST (CODE) VALUES('FRUIBA');
INSERT INTO TEST (CODE) VALUES('FRUITX');
INSERT INTO TEST (CODE) VALUES('FSAP');
INSERT INTO TEST (CODE) VALUES('FULL');
INSERT INTO TEST (CODE) VALUES('FVOM');
INSERT INTO TEST (CODE) VALUES('FWFM');
COMMIT;
2) Create a new application
-Drop a TIB_Connection (name it con) and hook it up to a test database
-Drop a TIB_DataSource, TIB_Query (name it sql1) and hook them up (and
to the connection)
-Drop a TIB_Grid, TIB_IncSearch and set the Datasource property
-Set the SearchKeyByKey and SeekNearest properties on the
TIB_IncSearch component to TRUE.
3) Set the Query up (note, these were all setup in the component
editor)
-SQL:
SELECT CODE, DESCR FROM TEST
-OrderingItems:
CODE=CODE;CODE DESC
DESCR=DESCR;DESCR DESC
-OrderingLinks:
CODE=ITEM=1
DESCR=ITEM=2
-SearchingLinks
CODE=CODE
DESCR=DESCR
4) Place:
con.Connect;
sql1.Prepare;
sql1.Open;
into the FormCreate method.
5) Run app and click on the Grid heading until the order of the code
field is decending. Then type in "fr" into the incremental search
edit.
You should see that the record selected is not the correct one. (In my
case it was "FISHSJ")
Any suggestions?
Setup:
Delphi 5 (update pack 1)
IBObjects 4.3.Aa
Firebird 1.5rc7
Windows 2000 sp4
thanks
Mark