Click to See Complete Forum and Search --> : wildcards and the MS Access ODBC connect string


lcscne
12-16-2003, 10:48 AM
I'm trying to use a wildcard in my WHERE clause:

WHERE (((txtLastName) LIKE'smith*')); by the way I'm building this string in my code so I'm opting for the single quote.

If I take out the asterik I get 3 records returned but only where last name = smith (no smithers) but with the asterik I get no records. I want Like to work the way its supposed to and return all records where the last name has smith as the first 5 chars.

I am using the ODBC driver to connect to the mdb file, is there some other wildcard character I should be using instead of *?

Connect string:

"Provider=MSDASQL;" & _
"DRIVER={Microsoft Access Driver (*.mdb)};" & _
"User Id=admin;" & _
"Password="

lcscne
12-16-2003, 10:55 AM
found it.

DAO wildcard = *
ADO wildcard = %

Thanks anyway.