query across two access databases

N

Naure

Hey guys, does any one knows if we can query on different databases?
like:
SELECT t1.*, t2.* FROM db1.table1 t1, db2.table2 t2 WHERE XXX


thanks a lot
 
A

Allen Browne

In some contexts you can specify the file name with IN, e.g.:
SELECT * FROM t1 IN "C:\MyFolder\MyFile.mdb";
 
J

John W. Vinson

Hey guys, does any one knows if we can query on different databases?
like:
SELECT t1.*, t2.* FROM db1.table1 t1, db2.table2 t2 WHERE XXX


thanks a lot

The simplest and most efficinet way is to link the table from the remote
database: use File... Get External Data... Link in db1, and link to the
desired table in db2.

If you have reason to not do so, there is an IN clause in the FROM expression.
See the online help for "IN Clause".
 
N

Naure

select sth
from
c:\some\somdb.table,
d:\some\somedb.table1
where
.....

this will do

Thank you guys very mcuh
 
J

John W. Vinson

select sth
from
c:\some\somdb.table,
d:\some\somedb.table1
where
....

this will do

It would if it would work, but - unless it's a new feature in 2007 that I
don't know about - it won't. Tables are not external files.
 
K

K Goh

I am using asp.net (vb) and ODBC to connect to one mdb file and and in an SQL
query I used the IN syntax to connect to another mdb file succesfully. But
that is for DSN-less connection. What if the external mdb is only accessible
via DSN? Is there a syntax that I can use to connect to it? I'm trying to
join one table from first mdb to another table in another mdb.

Any help in the right direction would be much appreciated. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top