Board index » delphi » IBQuery and Filtering

IBQuery and Filtering


2003-10-22 11:10:03 PM
delphi240
Hi,
I have one Query like;
Select Name,Number from Member
located in TIBQuery.SQL (called MemberQuery)
I want to filter it by using,
MemberQuery.Close;
MemberQuery.Filtered := False;
MemberQuery.Filter := 'Name = '+Edit1.Text;
MemberQuery.Filtered := True;
MemberQuery.Open;
But Nothing is changed!!!
Where is my Fault?
-----------------------
I can solve the problem that shown top by using parameters.
Select Name,Number from Member
where Name = : NameP
MemberQuery.Close;
MemberQuery.Param[0] := Edit1.Text;
MemberQuery.Open;
It works But
if Edit1.Text = '' then ??????
I need to list all data.
What is your experience for this. What is the best way or method to apply
this kind of multiple filtering?
This is just an example and in my application it is really hard to define it
by code :)
Any help will be appreciated.
 
 

Re:IBQuery and Filtering

Tanz Anthrox writes:
Quote
What is your experience for this. What is the best way or method to
apply this kind of multiple filtering?
You need to change the WHERE clause of your query. IBX doesn't do
Filter because client-side filtering is painfully inefficient in
comparison with applying a WHERE clause on the server.
-Craig
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : delphi.weblogs.com
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Editon users, get 6.0.1.6 from mers.com