I have an SQL query designed to search a string field and return results based on input from the user.
If I use VB.NET to interrogate the Access Db using the following SQL:
"Select *FROM TRAINING WHERE ((Trainer Like '*Rob*'));"
I get no results.
If I perform this same query directly in the DB (eg in Access iteslf) I get a number of hits (which are correct).
The code I'm using to create the connection etc is:
Dim adapter As OleDb.OleDbDataAdapter Dim Connection As OleDb.OleDbConnection searchResults = New DataSet Connection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Trainers.mdb") adapter = New OleDb.OleDbDataAdapter(searchText, Connection) adapter.Fill(searchResults) Connection.Close() ' Where searchText = ' "Select * FROM TRAINING WHERE (( Trainer Like '*Rob*'));"
(searchResults is defined as a DataSet outside of this procedure)
This code and the way I'm creating the query works for every other search I perform.
I'm not sure if its the version of VB Express/MS Access I'm using, or if I'm missing something simple.
Any help would be greatfully recieved.