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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Multiple Databases

Status
Not open for further replies.

ddpettie

Technical User
Apr 28, 2006
1
US
Hi all,
I'm a fairly new user to MS Access and I was trying to attempt to query multiple databases (not tables), but I'm not sure if there's a way to do this in MS Access. On the contrary, there methods of querying multiple tables as long as there is a relationship, but is there a way to query multiple databases that have a relationship. For example,

Database A
Table A

Database B
Table B

Database C
Table C

For each table within each database, there is a common identifier in each table that I can relate the databases to, but how can I even attempt such a query? Would it have to be done in SQL? Does anyone have any examples of such a query?

Thanks
 
Access does support this syntax
Code:
SELECT * 
FROM [;database=C:\SomePath\dbA.mdb].Table1 A
     INNER JOIN
     [;database=C:\SomeOtherPath\dbB.mdb].Table2 B
     ON A.fld1 = B.fld1
     etc.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Assumming you are working in Database D, right click in the table table tab and link to Table A, Table B, and Table C.

Then just use them in a query like any other table.

willybgw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top