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

linking queries in access 2002 2

Status
Not open for further replies.

safaryan

Technical User
Aug 17, 2006
8
US
Hi,

Is it possible to link a query in access 2002 from another mdb access database? It gives me only tables in the menu. Thanks in advance.

Max
 

As far as I know, the only object you can link to is a table, but you should be able to import the query.



Randy
 
Randy: It's a dynamic database, so I need to have a live connection to it. I am thinking there must be a way of linking a query from another access database. Thanks.
 
Don't believe there is and the reason would probably be that a query contains no data ... only SQL. If the query really exists in A.mdb and you were to link it to B.mdb and then run it from there, where would the SQL find the tables that it references?

In A.mdb? In B.mdb? Some combination of the two?

What happens if a referenced table exists in both A.mdb and B.mdb?

As randy700 says, you can import them and when you do, they become local to the database into which they were imported and expect the tables that they reference to be local as well (unless you've done something to explicitly redirect table locations in the SQL.)
 
Golom: I have got 8 tables on that remote database that the query is combining data from then doing some filtering and calculations. I guess my only option would be to link the tables from the remote database and run the query in the local database. Thanks all for your help, appreciated!
 
No. There's another option
Code:
Select * 

From [;Database=C;\...\A.mdb].QueryName
That will run the Query called "QueryName" in it's local environment and return the results to the environment where you are running the above SQL.
 
Golom: it worked - this is exactly what I wanted. Thanks, I love this place!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top