Solved

Joining the data from two databases

Posted on 2002-05-09
5
123 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now