Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use 2 ADO connections in one query?

Status
Not open for further replies.

tallman64

Programmer
Nov 2, 2000
8
0
0
CA
Hello,

I have a situation where i have need 2 connections (one to Excel and one Access) to create a recordset.

I have no trouble querying these two sources separately. Typically I use a statement such as the following:

...
rsRecordset.Open strSQL, cnExcel, adOpenStatic, adLockReadOnly
...

in my new situation, strSQL requires field names from 2 sources i.e.

(from Access SQL view)

SELECT Tables.Business_Unit, Count(Database.CL) AS CountOfCL, Sum(Database.[EXT QT]) AS [SumOfEXT QT]
FROM [Database] INNER JOIN Tables ON Database.CL = Tables.Class
GROUP BY Tables.Business_Unit
ORDER BY Sum(Database.[EXT QT]) DESC;

where "Tables" is an MS Access source and Database is an Excel spreadsheet.

Can someone help me bark up the right tree?

thanks in advance,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top