Re: TADODataset.Filter?



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.

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


http://www.infosnap.eu

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

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


Sven Pran wrote:
"Bill Todd" <no@xxxxxx> wrote in message news:453a2ceb$1@xxxxxxxxxxxxxxxxxxxxxxxxx
If you are using a client-side cursor, which loads the entire result
set into local memory, then a filter may be faster.

--
Bill Todd (TeamB)

Thanks,

I have made some tests (and documentation searches)
but I cannot get filtering on partial text to work?

name = 'smith' returns all (and only) the records where
the field 'name' value is exactly 'smith' (or 'Smith'), but
name = 'sm*' (or name = "sm*") returns no records at all?

I have not been able to find and inspect the property
ADODataset1.FilterOptions in the object inspector, but
I have every reason to believe that it is empty, which
according to the help system is the default implying that
the asterisk is treated as a wildcharacter representing
any number of any characters.

At present I am stuck.

regards Sven


.



Relevant Pages

  • Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
    ... the above filter for scoring but it didn't work. ... So I verified that the regular expression did indeed work. ... Do I need to use regular expressions in the group specifier, too, like ... how come the asterisk works by itself instead of having to use ...
    (news.software.readers)
  • Re: halcyon pcs filter
    ... They use the asterisk instead LIKE. ... When a string in a filter ends with an asterisk, it can be used to match ... To disable matching of partial strings and to treat the ... I used PCS ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: what is purpose of asterisk in date format *3/2/07?
    ... Does the asterisk appear in the formula bar when you select that cell? ... Date formats display date and time serial numbers as date values. ... when i use advance filter, a line with a date in it formated with the ...
    (microsoft.public.excel.worksheet.functions)
  • Trouble with rs.Filter not recognizing wildcards (*)
    ... I am trying to apply a filter to a recordset in VBA and it works ... filter string is is something like this: ... If I put any character and an asterisk (ex. ...
    (microsoft.public.access.queries)