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

  • Thread starter Thread starter Joshua Ellul
  • Start date Start date
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
 
Back
Top