Solved

Joining the data from two databases

Posted on 2002-05-09
5
127 Views
Last Modified: 2010-04-04
Hi guys,

How would I join the data from two databases?  I have to connect to a FoxPro Database and an Access database, perform a query in each, and then display the results from both queries in a single DBGrid.  Any ideas on the best way to do this.  I am offering alot of points as this is an urgent problem that I need fixing.  I am using Delphi 6.

Cheers
0
Comment
Question by:gtbikeuk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6999243
with bde,
use two tdatabases or provide as databasename the two different aliases

with ado,
use two adoconnections
0
 
LVL 3

Accepted Solution

by:
marcoszorrilla earned 400 total points
ID: 6999258
With Access:
1º.- Create a Compatible table with both (Access and Fox Tables).

2º.- Create a query that delete all the records .

3º.- Create a query that Add all the rows from Access table to the New Access Table.

4º.- Create an other query tha do the same with the Fox Table, (the fox Table must be linked via Access).

Now you connect via ADO with Access and execute this StoreProcedures.

Link the resulting Table via AdoTable and a Dataset, and  link the Dbgrid with this Dataset.

Bye.
0
 
LVL 6

Expert Comment

by:swift99
ID: 6999891
Link the Foxpro tables into the Access database, then run your query against the Access database.  The DAO provides the transparency layer that performs the join, and is reasonably fast about it.  I have used this technique with Access in a pinch to resolve cross database issues in multi-terabyte mainframe databases.

In Access
* use Insert | Table ... Link Table,
* select "FoxPro" in the "Files of Type" entry
* Select the tables you want to link

From this point on the Foxpro tables will be transparently available to any application in any platform that talks to the Access database.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 7000486
The Swift99 answer is the correct answer, barring any unforseen problems.  

Make sure your FoxPro table is properly indexed and your Access table has an index on the joined column(s).
0
 
LVL 45

Expert Comment

by:aikimark
ID: 7088377
gtbikeuk,

Why did you select the more complicated, slower, and troublesome solution?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question