Hello,
I am trying to run a query from an Excel macro. I found this query by viewing a query from the query editor in Access in SQL view. This is what I got (with double quotes put around the name of the text I'm querying for):
string = "SELECT table.column1, table.column2 FROM table WHERE ((table.column1)=""value""));"
However, when I try to run this query, I get the error "Invalid column name "value"."
I have also tried the following variations:
string = "SELECT table.column1, table.column2 FROM table WHERE ((table.column1) Like ""value""));"
string = "SELECT table.column1, table.column2 FROM table WHERE table.column1=""value"";"
string = "SELECT table.column1, table.column2 FROM table WHERE (table.column1=""value"");"
string = "SELECT table.column1, table.column2 FROM table WHERE table.column1='value';"
string = "SELECT table.column1, table.column2 "
string = string & " FROM table"
string = string & " WHERE (((table.column1)=""value""));"
Can anyone tell what I am doing wrong?
thanks in advance,
catalpa
I am trying to run a query from an Excel macro. I found this query by viewing a query from the query editor in Access in SQL view. This is what I got (with double quotes put around the name of the text I'm querying for):
string = "SELECT table.column1, table.column2 FROM table WHERE ((table.column1)=""value""));"
However, when I try to run this query, I get the error "Invalid column name "value"."
I have also tried the following variations:
string = "SELECT table.column1, table.column2 FROM table WHERE ((table.column1) Like ""value""));"
string = "SELECT table.column1, table.column2 FROM table WHERE table.column1=""value"";"
string = "SELECT table.column1, table.column2 FROM table WHERE (table.column1=""value"");"
string = "SELECT table.column1, table.column2 FROM table WHERE table.column1='value';"
string = "SELECT table.column1, table.column2 "
string = string & " FROM table"
string = string & " WHERE (((table.column1)=""value""));"
Can anyone tell what I am doing wrong?
thanks in advance,
catalpa