ADO wants the ANSI_SQL wildcards of % and _ NOT JET's * and ?. I'd lose
the trailing semicolon too, that an Access thing.
Set RS = DBConn.Execute("SELECT COUNT(*) AS Num FROM Addresses WHERE
FirstName LIKE '%John%'")
HTH
--
Patrick Logan, MCSD
Opinions expressed are my own and not necessarily those of my employer.
Quote:
> Hi everyone,
> I have the following problem concerning ADO, Access97 and the
> LIKE-operator:
> Set RS = DBConn.Execute("SELECT COUNT(*) AS Num FROM Addresses WHERE
> FirstName = 'John';")
> yields 123 for Num, BUT
> Set RS = DBConn.Execute("SELECT COUNT(*) AS Num FROM Addresses WHERE
> FirstName LIKE '*John*';")
> yields 0 for Num.
> I just can't figure out what's wrong here. Can somebody help me?
> Thanks and regards - Jan