As you proably know, you cannot join tables unless they exist in the
same database. As you are dealing with a temp table, consider linked
servers. If you are using SQL Server (usually the case when stored
procedures are mentioned this ng) you can link to the Excel workbook
from there via Enterprise Manager.
If it's not SQL Server, or you do not have Enterprise Manager rights,
consider using a linked table in a Jet database created on the fly.
Personally, I'd prefer to import the data into Excel and query from
there using ADO. Yes, you can do quite complex queries on Excel data
but you are limited to the syntax of the MS OLEDB provider for Jet.
Version 4.0 is pretty good but it's a significantly short of ANSI
SQL-92 compliance.
If you choose the Jet linked table route, I'll point out don't need
the MS Access application to create and/or query a Jet database (.mdb
file), including linking tables. You can do all this on the fly using
only Excel and ADOX (to create the .mdb file) and ADO (use DDL
statements to create the schema e.g. CREATE TABLE etc and SQL for
queries).
You do need MDAC, free MS download and shipped with Excel, and Jet,
free MS download and shipped with early versions of MDAC, so it's
highly likely you already have the necessary components shipped with
Excel.
See the following links (in these articles, read 'Jet' for the word
'Access'
because the MS Access application is not actually used):
Creating an Access(sic) Database:
http://msdn.microsoft.com/library/d...s/odeopg/html/deovrcreatingaccessdatabase.asp
Running a Temporary Query:
http://msdn.microsoft.com/library/d...s/odeopg/html/deovrcreatingaccessdatabase.asp
Creating a Linked Table:
http://msdn.microsoft.com/library/d...n-us/odeopg/html/deovrcreatinglinkedtable.asp