Re: TADODataset.Filter?




"Dennis Passmore" <dennis_passmore@xxxxxxxxxxxxxxxx> wrote in message
news:7ksmj2hkoah0jcms0al9v0mv6r16cusfu9@xxxxxxxxxx

But if I close the dataset will then not also the SQL SELECT command
be executed again

Yes it will, I had it in my example but I should have removed it. One
thing you should
do is DisableControls and after updating the Filter then EnableControls
so the DbGrid will then refresh itself.

ADODataSet1.DisableControls;
ADODataSet1.Filtered := false;
ADODataSet1.Filter := 'LastName Like ' + QuotedStr('Fu*'); //Fuller
ADODataSet1.Filtered := true;
ADODataSet1.EnableControls;

I haven't gotten around to testing today after all. But what you write
here is really interesting. I would definitely not be surprised if
DisableControls and EnableControls is the clue to my filter problems!
(I understand that I depended upon DBGrid to update itself automatically
on changes in TADODataset filtering).

regards Sven


.



Relevant Pages

  • Re: TADODataset.Filter?
    ... so the DbGrid will then refresh itself. ... DisableControls and EnableControls is the clue to my filter problems! ... response to the Filtered property being changed. ...
    (borland.public.delphi.database.ado)
  • Re: TADODataset.Filter?
    ... are you sure your DBGrid is connected to the correct DataSource / DataSet? ... here is the event handler for the "filter" button click: ... No error message and no filtering? ... but the DBGrid display did not change, ...
    (borland.public.delphi.database.ado)
  • Re: TADODataset.Filter?
    ... all I have the correct results when I do not use the filter property? ... properties either or both in TADODataset and in TADOQuery. ... are you sure your DBGrid is connected to the correct DataSource / DataSet? ... I tried this tonight and got a most surprising result: ...
    (borland.public.delphi.database.ado)