Searching a Database

Aidan

New member
Joined
Feb 11, 2005
Messages
3
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?

Any help would br greatly appreciated!
 
Variable

If i were to search the database using a variable as opposed to a name would i use the same code?
 
Yeah! well:

Code:
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 & ""
 
Back
Top