Discussion Locked

create select query with diff. mdb files

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i created two ms access database to hold my data.
how can i create a select query that will include the table from the other database?

can someone please help me..............?

any strategies/techniques/ideas will sure be of help.

thanks.

5 replies

by 3xp3rt

You need two Queries. One with Select command for one table, other with select command for the other table. A try to write an example in Delphi, how can this work.

ADOQuery1.SQL.Add(?select * from table1?);
ADOQuery2.SQL.Add(?select * from table2?);
Repeat
Begin;
ADOQuery1.SQL.Clear
ADOQuery1.SQL.Add(?insert into table1(field1,field2) values(?+ADOQuery2.SQL. FieldValues[?fieldA?]+?,?+ ADOQuery2.SQL. FieldValues[?fieldB?]+')');
ADOQuery1.SQL.Execute;
ADOQuery2.Next
End;
Until ADOQuery2.EOF

There are many other possibilities, (for example Visual Foxpro? is the easiest way. ?use table1 append from table2).
I hope help.

by dfirefire

Open one of the db's;
In the file menu, select import or link data;
Navigate to the second mdb;
Select the table to import or link;
Now this table is visible in the tables list;
Create a qry like you would with two internal tables.
Good luck!

by dfirefire

Open one of the db's;
In the file menu, select import or link data;
Navigate to the second mdb;
Select the table to import or link;
Now this table is visible in the tables list;
Create a qry like you would with two internal tables.
Good luck!

by stevef199

If you have two Access databases A and B.

You are in a query window in database B and need to access a table from database A. Then you need to create links to the required tables from database A. Now, you can use these linked tables in your query.

Hope this is what you needed.

Cheers,
Steve

by stevef199

If you have two Access databases A and B.

You are in a query window in database B and need to access a table from database A. Then you need to create links to the required tables from database A. Now, you can use these linked tables in your query.

Hope this is what you needed.

Cheers,
Steve

This discussion is closed to new replies.