Query multiple databases using DAO 
Author Message
 Query multiple databases using DAO

Hello!

I'm trying to make a query that can work with multiple databases (I'm
using DAO)

The first database contains three tables
FIELDS
SELECTED
RESULT

In the table FIELDS there is a specification on which fields that
should be used from the data database.
SELECTED contains all selected objects with a unique key for each
RESULT will contain the queried data

I also have 5 data databases. Depending on the SELECTED key the data
is in one of the databases. All databases contains the same tables

I now need to create a query which JOIN db1.SELECTED with the correct
datadb and create data in db1.RESULT

If the data tables was in the same database I would use this query:

SELECT SELECTED.KEY, DATATABLE.FIELD1 FROM DATATABLE INNER JOIN
SELECTED ON SELECTED.KEY = DATATABLE.KEY

Here the data table is DATATABLE and the data field is FIELD1

(I then use a second query to insert this to the RESULT table)

How would I write the query when the DATATABLE is in another
database??

// Anders



Fri, 06 Feb 2004 22:07:45 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Access Database remains open after destroy dao query .(using mfc)

2. Multiple apps accessing the same database (DAO + MFC)

3. Using DAO to Export a Query in Access

4. how to make multiple node queries on xml document using Xpath

5. To commit a query using API call of Solid Database in C

6. Querying a database by using MFC ODBC and MSQL 6.5

7. Does ANYONE understand multiple recordsets/views using DAO???

8. Need DAO examples for using multiple CDAORecordView classes

9. Using DAO classes to connect to secure MS-Access database

10. Restructuring a Microsoft Access database using VC++ 5 and DAO

11. database console apps using DAO, How to ?

12. Opening databases using MFC/DAO

 

 
Powered by phpBB® Forum Software