catgirl78
March 17th, 2001, 02:37 PM
My VB application provides a search facility for user to search for a particular restaurant.
the application allow the user to enter the restaurant name and search against the database (MS access) and return with record that have similar name.
i use the SQL:
Search_Data1.DatabaseName = App.Path & "\eat&go out guide.mdb"
Dim qry
qry=" SELECT Restaurants.RestName FROM Restaurants"
qry = qry + " WHERE Restaurants.RestName LIKE" + "'" + "%" text1.text + "%" + "'"
Search_Data1.RecordSource = Qry
so if the user enter "royal" in the text box, it should return all records with name that had "royal" ..but it doesn't work..
can anyone tell me what is wrong with the query....thanks
the application allow the user to enter the restaurant name and search against the database (MS access) and return with record that have similar name.
i use the SQL:
Search_Data1.DatabaseName = App.Path & "\eat&go out guide.mdb"
Dim qry
qry=" SELECT Restaurants.RestName FROM Restaurants"
qry = qry + " WHERE Restaurants.RestName LIKE" + "'" + "%" text1.text + "%" + "'"
Search_Data1.RecordSource = Qry
so if the user enter "royal" in the text box, it should return all records with name that had "royal" ..but it doesn't work..
can anyone tell me what is wrong with the query....thanks