real time filtering

real time filtering

Postby ben » Tue 23 Aug 2005 09:05

Hello,

my interface has the following options

[ All Records ]
[ Records A ]
[ Records B ]
[ Records C ]
[ Records D ]
...

and a search box:

Search: [__________________]

that filters records inside the selected area. Example:

SELECT * FROM records
WHERE name LIKE 'A%'
ORDER BY name

when user types on the search box "George"

the query will be:

SELECT * FROM records
WHERE name LIKE 'A%' and name like '%George%'
ORDER BY name

---

In my code:

MyQuery1.SQL.Strings[1] := 'WHERE...";
MyQuery1.Open;

---

is this the right way to do it or is there another better trick?

Thanks
ben
 
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Postby Ikar » Tue 23 Aug 2005 09:54

Try to use MyQuery1.Filter and MyQuery1.Filtered properties
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components