[DUG] Filtering Dataset

John Bird johnkbird at paradise.net.nz
Fri Dec 5 17:39:56 NZDT 2008


I solved the filtering problem - well had to work around it.  The dataset 
concerned hads stacks of events on scroll etc, and I found if I opened a 
fresh copy of the dataset with clean data and no events it worked fine.

So I have a nice tool - can search anywhere in a dataset for any string (ie 
searches all string fields, and searches within each field).

A neat trick - once have a list of fieldnames from AlphaFieldname[x] := 
Dataset1.Fields[i].Fieldname can search using code like

  cdsFind.Filteroptions := [foCaseInsensitive];
   cdsFind.Filter := AlphaFieldname[x] + ' LIKE    ' + quotedstr('%' + 
Findstr + '%');

Thanks to whoever it was who pointed out you can use this syntax on filters, 
and yes it also finds matching strings at the beginning of the field data (I 
was wondering about that until I tested it).

John 



More information about the Delphi mailing list