I have just started using the ADO components that come with Delphi 7 and I
am having problems with queries against a microsoft access database.
I am using TADOConnection components with TADODataSet. The latter is linked
to a TDataSource component and then onto a DBGrid. The Connection is
specified as using Microsoft Jet OLEDB.4.0 and I use the CommandText
property of the TADODataSet to get the data. This all works fine except that
wildcards are not being processed correctly or not at all.
I have tested all the queries out in the microsoft access database and
queries such as
Where name like "B?ll", Where name like "B[ioa]ll", where name like "B*" all
give the proper results with * replacing everything, ? replacing a character
and [ioa] matching with Bill, Bob, Ball etc just as they should.
When I send these through the ADO components the queries do not work. To be
specific the ? and * do not work at all and the [aio] does work. I am
changing the CommandText and requerying the data every time I change the
I did use the * command as a filter property of the TADODataSet component
instead of as part of the where clause and this did work but the ? and [aio]
will not work as part of a filter.
Does anyone know what I am doing wrong or whether there are some problems
with characters being used as control characters.
Any help would be most appreciated.