views:

56

answers:

1

Could you please provide me with a simple example of using the Filter Property of ADOQuery in Delphi 7?

Thanks.

+3  A: 

as looking into histroy question i got into this question:

http://stackoverflow.com/questions/2312444/delphi-ado-query

which said by RRUZ that:

AdoQuery1.close;
AdoQuery1.filter := 'your condition goes here';
AdoQuery1.filtered := true;
AdoQuery1.Open;

Edit: or just :

AdoQuery1.filter := 'your condition goes here';
AdoQuery1.filtered := true;
none
It is not necessary to close, set the filter and then open the query. Just set the condition (e.g. somefield=1) even on an open query and then Filtered := true;.
avenmore