Hi
I am querying my ingres database through ODBC using the Provider=MSDASQL.1, and am having trouble with the where clause as I want it to look up the contents of my variable which the user sets example 2.

Example 1
This brings back all the records for FRED and works
"SELECT table1.firstname, table1.secondname FROM table1 WHERE table1.firstname ='FRED' "

Example 2
How would I ensure this searches the varaible of x in the where clause.
Dim x as string
X = “Fred”
"SELECT table1.firstname, table1.secondname FROM table1 WHERE table1.firstname ='FRED' "
Many Thanks for your help