Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TIBQuery Filter Property ?

Status
Not open for further replies.

Oppenhiemer

Programmer
Jun 28, 2001
315
GB
Hi -

While using the TIBQuery component for Interbase, I would like to filter the records displayed. So I thought I would simple set the filter property for this component. WRONG!

Or at least it does not seem to work the way Im using it. If I try setting the filter property at runtime using code such as :

MediaQry.Filter := 'ORDER_NO = 12';
MediaQry.Filtered := true;

Nothing happens. The records are left un-changed (no filter is applied.) I have tried messing with the FilterOptions property and closing - then opening the Query again, all to no avail.

Could anyone please tell me where Im going wrong ?

Many thanks..

Opp.

P.S The exact expression of the filter shown here is just by example, I have tried several variations all with no luck.
 
hi,

If you write ibquery.filtered := true. It will do nothing.
It only states that the database is filtered. You are used to the filter of a table where the property filtered actually activates the filter.
With IBQuery you better change your SQL query like

ibquery.clear;
ibquery.sql.add(select * from orders);
ibquery.sql.add(where Orders = ''12''');
ibquery.open;

steph.
 
Ahh.. so that means that the filter property for the IBQuery actually does nothing then ?

The method you suggest is actually bypassing the filter all together. What I actually wanted to do was allow the user to futher filter an already filtered (using SQL criteria) dataset.

Thanks..

Opp.

 
Just came across this article :

In-memory filtering is not supported except in TIBTable, where FilterOptions for case insensitivity and partial matches are not implemented. Integration of the filtered set with the FindFirst, FindNext, FindPrior and FindLast methods has not been implemented.

Here is the URL if anyone wants to check it out :


Opp.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top