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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ClientDataset Filter and Wildcards

Status
Not open for further replies.

Dave1024

Programmer
Oct 28, 2011
6
GB
Hi -

I am using Delphi 2009 and cannot seem to find a way to use the "filter" property to filter for wildcards properly. Basically, I would like to be able to use wildcards in the filter property to filter recrods that contain the string the user enters.

I can get it to work sort of,using one wildcard such as,,

CDS_FIND.Filter := Fname + ' like '+ QuotedStr(ToFind.Text + '*') ;

Where "Tofind" represents the control holding the criteria to search for.


But I cant get it to work like this..

CDS_FIND.Filter := Fname + ' like '+ QuotedStr('*'+ToFind.Text + '*') ;

So it matches any results that "contain" the search criteria.

Reading some information on the subject adn it says that Clientdataset filter returns partial matches by default. But this simply is not the case.

I want to be able to filter records based on criteria entered by the usesr and use the "FindNext" - "FindFirst" and other functions to let the user navidate the results (or at least set the fitler so they can navigate t=he the sub-set of records.

Any help on this would be much appreciated.

Cheers.,.

Dave.
 
Dam, cant seem to see the feature to "edit a post" (its been a while.)

Also meant to say that I have tried other wildcard characters, just in case that was an issue, still no joy.

Thanks.

Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top