I have set up an access database and i am accessing it through sql statements.Would anyone be able to tell me how to search the database by a customers name?
Dim strSelectStatement As String
Dim strSearchTerm As String = "James"
The single () quotes are important when searching on text
strSelectStatement = "SELECT * FROM customer WHERE CustomerName = " & strSearchTerm & ""
You can also choose which fields you want returned as well. No sense in grabbing every field if all you need is their address. Anyway, here is a list of MySQL commands.. should come in handy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.