SQL query with LIKE condition does not work using an adapter (and filling a dataset) but works in Ac

J

Joshua Ellul

Hi There,

I am trying to run the following query:
"SELECT * FROM Persons WHERE FirstName LIKE 'A*'"

This query returns all records that have FirstName starting with 'A'.

Here's my code:

SqlStr = "SELECT * FROM Persons WHERE FirstName LIKE 'A*'

Dim myCon As New OleDb.OleDbConnection(DBStr)

Dim myAdapter As New OleDb.OleDbDataAdapter(SqlStr, myCon)

myAdapter.Fill(myDS, "Persons")


Could anyone tell me why this query works in Access but not through the data
adapter?
It works fine with any other query.

Thanks,

Josh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top