Re: TADODataset.Filter?



Oops! I forgot to quote the search string! The correct syntax would be:

// name starts from "bi"
ADOQuery1.Filter := 'name Like ' + QuotedStr('bi*');

// name contains "bi"
ADOQuery1.Filter := 'name Like ' + QuotedStr('*bi*');

Sorry for the error!

Bill.

-----------------------------------------------------------------------------------------


http://www.infosnap.eu

Home page of InfoSnap - the powerful, all-purpose information and knowledge-base manager.

-----------------------------------------------------------------------------------------


Bill Dekleris wrote:
The wildcard charcter is the asterisk, but you should use the "Like" operator. Thus, if you want to make a partial search using TAdoDataset filter, you should use a command like this:

ADOTable1.Filter := 'name Like bi*'; // name starts from "bi"
or
ADOTable1.Filter := 'name Like *bi*'; // name contains "bi"

Regards,

Bill Dekleris.

.