Subject Re: [firebird-support] incremental search ?
Author Kjell Rilbe
Den 2011-04-08 05:26 skrev Sergio H. Gonzalez såhär:
> Hello! probably this is a silly question, but I'd like to know other's
> experiences in this matter. I'd like to implement an incremental search
> facility in some forms. I think I've read somewhere that incremental
> search is not a good idea on client/server databases... so my first
> question: is that true?
>
> I'm using Firebird 2.1 with Delphi / IBX components and I'm testing with
> a very simple method: on the OnChange event of an Edit box I close the
> query (select * from my table where name containing :somename) pass
> Edit1.Text as parameter and open the query again. So far (and with a few
> thousand records) it seems to be ok. So the next question: Is that
> method OK? should I be aware of someting in the future? I didn't test it
> with A LOT of records yet so I'd like to hear any advice. Thank you very
> much!!-Sergio

Ah, also, in case the dropdown takes a second or two to refresh, then
make sure you can interrupt it. I mean it should be like this:

Type A.
Start refresh for "A".
Type B.
Type C.
Refresh for A completes.
Start refresh for "AB".
Type D.
Type E (stop typing...).
Refresh for "AB" completes.
Start refresh for "ABC".
...

Instead do it like this:
Type A.
Start refresh for "A".
Type B.
Discard refresh for "A" and start refresh for "AB" instead.
Type C.
Discard refresh for "AB" and start refresh for "ABC" instead.
Type D.
Discard refresh for "ABC" and start refresh for "ABCD" instead.
Type E (stop typing...).
Discard refresh for "ABCD" and start refresh for "ABCDE" instead.
...wait few seonds.
Refresh for "ABCDE" completes.

Not sure exactly HOW to do this, but I'm sure it's possible one way or
another.

Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64