Re: Query Two Databases



JSzabo wrote:
Hi,

I am (still) developing with VB 6.0 and MS Access 2000 on Win98-R2.

Is it possible to easily/reliably query two tables that each exist in a different database, then return the results in a single recordset? Or must I create a linked-table reference in one of the databases? Or must I do something else … ?
[...]
Using 2 copies of nordwind.mdb (c:\temp\nordwind1.mdb, c:\temp\nordwind2.mdb)
the statement

    select   B.[Bestell-Nr]
           , B.[Kunden-Code]
           , K.[Kunden-Code]
           , K.[Firma]
    from   Kunden       as K
         , Bestellungen as B in "c:\temp\nordwind2.mdb"
    where B.[Kunden-Code] = K.[Kunden-Code]

works (for me) as expected when executed from a oledb/jet
connection to c:\temp\nordwind1.mdb.
I admit, the syntax of a IN-clause is hard to get right
(I had to experiment a bit), so YMMV.
.