Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Joining the data from two databases

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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
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

610 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