Join tables from different databases

G

Guest

I am trying to compare two tables from different databases.
Table1 from msaccess database
Table2 from MSDE database
Linking the tables in one database is an option but i'm looking for a way to
do it in the SQL syntax.
 
J

Jeff Boyce

Noam

I'm not sure I understand what you mean by "linking the tables in one
database", nor "do it in the SQL syntax".

If I were faced this comparing tables from separate databases, I would open
one of them (or a totally new db), link to the table(s) in the database(s),
and write queries to compare them.
 
G

Guest

This is exactly what I am trying to avoid. I do not want to link the tables
in one database. I'm trying to retrieve the result as a recordset based on an
SQL string.
I know there is a way to reffer to a table in a defferent database by using
the IN clause (From Table1 in '<DatabasePath>') but I can't join between the
tables to retrieve the data.

Jeff Boyce said:
Noam

I'm not sure I understand what you mean by "linking the tables in one
database", nor "do it in the SQL syntax".

If I were faced this comparing tables from separate databases, I would open
one of them (or a totally new db), link to the table(s) in the database(s),
and write queries to compare them.
 
V

Van T. Dinh

You should be able to. The SQL should be something like:

SELECT ...
FROM [Table2] INNER JOIN [Table1] In ...
ON Table2.IDField = Table1.IDField
WHERE ...

You don't need to link Table1 to the database (where Table2 resides) you are
running
the query / SQL from.
 

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