G
Guest
I am trying to create a select that uses the LIKE operator. If I leave off
the where clause I get all the data but when I add the where with a LIKE I
get nothing. If I paste it into access it runs fine. Am I missing something
in the way it is formatted? Here is what I am using.
strSQL = "SELECT CatalogID, tProductDescription, tDocument "
strSQL &= "FROM tblCatalog WHERE tProductDescription LIKE '*SONIX*'"
Try
oCmd = New OleDb.OleDbCommand
With oCmd
.Connection = _
New OleDb.OleDbConnection(strConn)
.Connection.Open()
.CommandText = strSQL
oDR = .ExecuteReader()
End With...
There are many rows with the word SONIX in them and like I said it works in
access but not when I call access from VB.
Thanks,
John
the where clause I get all the data but when I add the where with a LIKE I
get nothing. If I paste it into access it runs fine. Am I missing something
in the way it is formatted? Here is what I am using.
strSQL = "SELECT CatalogID, tProductDescription, tDocument "
strSQL &= "FROM tblCatalog WHERE tProductDescription LIKE '*SONIX*'"
Try
oCmd = New OleDb.OleDbCommand
With oCmd
.Connection = _
New OleDb.OleDbConnection(strConn)
.Connection.Open()
.CommandText = strSQL
oDR = .ExecuteReader()
End With...
There are many rows with the word SONIX in them and like I said it works in
access but not when I call access from VB.
Thanks,
John