Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 07-13-2010, 05:48 AM   #1
GIS
Beta Member
 
Join Date: Jul 2010
Posts: 1
Default 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
__________________

GIS is offline   Reply With Quote
Old 07-13-2010, 02:42 PM   #2
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: OLE DB help: Using data from an excel cell as a parameters in command text

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.
__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 07:02 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0