TADODataset.Filter?



I use the following SQL statement to retrieve records
from a local Access database and display them in
a DBGrid:

SELECT spillernummer, fornavn, etternavn FROM mpData
WHERE fornavn LIKE "AB%" AND etternavn LIKE "DE%"
ORDER BY etternavn, fornavn, spillernummer

This works fine, but I am wondering if I rather than execute
the same SQL statement each time I modify the text 'AB'
or 'DE' would be better off by using the filter property of
TADODataset? I always start the application retrieving
the entire dataset, i.e. the WHERE part of the statement is:

WHERE fornavn LIKE "%" AND etternavn LIKE "%".

I have tried to find some information in the documentation
on the advantage or disadvantage of using "Filter" and also
on how to code the filter in the above case ('Include all
records where the values in the named field begin with the
characters specified').

Sadly to say I haven't found any good answer to either
question and my attempts of coding filter by intuition have
been greatly unsuccessful.

Should I bother with TADODataset.Filter at all, and in case
how do I code the value of that property?

Or should I just continue using SQL SELECT over and over
again within the application?

Comments appreciated.

regards Sven


.



Relevant Pages

  • Re: Need help applying SQL statement to Access2000 Query
    ... Why not just create a filter string ... construct the filter string and then open the main form (or report). ... Need help applying SQL statement to Access2000 Query ... The selection criteria are optional. ...
    (microsoft.public.access.formscoding)
  • Option Group not requerying after remove filter
    ... I have an unbound main form with a bound (to an SQL statement) subform. ... then unapply the filter. ... Dim frm As Form ...
    (microsoft.public.access.formscoding)
  • Re: Filter in my form
    ... If it is a SQL statement, ... If it is a query, open the query in design view, switch to SQL View (View ... Allen Browne - Microsoft MVP. ... It used to have a filter in the table ...
    (microsoft.public.access.forms)
  • Re: Filter in my form
    ... If it is a SQL statement, ... If it is a query, open the query in design view, switch to SQL View (View ... It used to have a filter in the table ... bars back on the subforms. ...
    (microsoft.public.access.forms)
  • RE: Form Searching
    ... >> built-in function can only search by one criteria though. ... > You may be interested in using the built-in filter functions instead. ... > You'll never see the actual SQL statement, but to execute it just select the ... It's a lot better than the built-in Search function, ...
    (microsoft.public.access.formscoding)