?
Solved

Joining the data from two databases

Posted on 2002-05-09
5
Medium Priority
?
129 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 1200 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 46

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 46

Expert Comment

by:aikimark
ID: 7088377
gtbikeuk,

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

Featured Post

Industry Leaders: 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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