OLE DB help: Using data from an excel cell as a parameters in command text

GIS

Beta member
Messages
1
OLE DB help: Using data from an excel cell as a parameter in command text

Hello,

I'm new to this
I'm trying to retrieve data from an oracle database through an OLE DB connection in Microsoft Excel 2007.

The query works fine when I write the SQL code in the command text area as
select col1,col2,col3 from table1 where val1=5

I would like to use a variable instead of a fixed value for val1, and this variable should be the value of an excel cell, how can I do that?

I want to able to have something like
select col1,col2,col3 from table1 where val1=$A1, but I haven't been able to have this accomplished because I don't know the right format.

Thank you
 
I've never tried doing the above since I've never needed to - but what error do you get when you run the latter select statement? Does it take the literal value $A1?

It may only be possible using a VBA macro or similar.
 
Back
Top Bottom