General discussion

Locked

create select query with diff. mdb files

By madocustodio ·
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.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by 3xp3rt In reply to create select query with ...

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.

Collapse -

by dfirefire In reply to create select query with ...

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!

Collapse -

by dfirefire In reply to create select query with ...

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!

Collapse -

by stevef199 In reply to create select query with ...

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

Collapse -

by stevef199 In reply to create select query with ...

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

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums