Recent

Author Topic: filter a TDBF with a TDBGrid  (Read 9770 times)

christophe_D

  • New Member
  • *
  • Posts: 20
filter a TDBF with a TDBGrid
« on: March 06, 2007, 07:01:12 am »
how is possible to filtering a TDBF , when the Data Base is view with a TDBGrid

in the doc of TDBF the function filter is the solution i hope
but it's not really clear

have you some an example ??

thank for your help

RudieD

  • Full Member
  • ***
  • Posts: 234
RE: filter a TDBF with a TDBGrid
« Reply #1 on: March 06, 2007, 12:54:09 pm »
You mean something like this
Code: [Select]

DBF1.Filter := 'Field1="SomeValue"';
DBF1.Filtered := True;
The FRED Trainer. (Training FRED with Lazarus/FPC)

christophe_D

  • New Member
  • *
  • Posts: 20
Re: RE: filter a TDBF with a TDBGrid
« Reply #2 on: March 07, 2007, 05:17:10 pm »
Quote from: "RudieD"
You mean something like this
Code: [Select]

DBF1.Filter := 'Field1="SomeValue"';
DBF1.Filtered := True;


thank , but with this, there an "violation error" :(

i'm found this

Code: [Select]
procedure TForm1.MybaseFilter(DataSet: TDataSet;
  var Accept: Boolean);
begin
  Accept:=Mybase.FieldByName('Field1').AsInteger>=2;
end;


and it's work fine !!

 

TinyPortal © 2005-2018