Solved

Can I use ado SQL within Excel 2003 VBA to reference worksheets (tables) in two different workbooks in the same query?

Posted on 2010-09-15
1
685 Views
Last Modified: 2012-05-10
I am very used to using the JET DB engine in VBA with ADODB to query worksheets using SQL in Excel 2003.  However, the query always referenced sheets in one workbook at a time.  Is it possible to open two connections to two different workbooks and perform a join between two sheets in the different workbooks?  If so, how would I qualify the reference in the SQL query?
0
Comment
Question by:VBAGuy
1 Comment
 
LVL 11

Accepted Solution

by:
jkpieterse earned 500 total points
ID: 33689145
I doubt if you can do that, but maybe this discussion gives you some pointers:

http://www.vbaexpress.com/forum/showthread.php?t=26862
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now