Solved

Fetching from 2 MSAccess Databases

Posted on 2002-04-28
6
172 Views
Last Modified: 2010-05-02
Hi expeees

i need to fetch records from tables from 2 different databases of MSACCESS, ex. I have Database1.mdb and Database2.mdb and both the databases have TBL1 table, i want to fetch all the records from both the databases to one recordset. Is it possible? your advice help to me a lot

Thanx in advance

0
Comment
Question by:vksharath
[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
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 6976304
Yes it is possible.

Can you make changes to either database?  If so you could link the table from the other database to yours.

Are the records in the two database related in anyway or will the recordset be more of a union of the two?

good luck
mlmcc
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 6976482
I do not think it is possible with one select statement.
What about your primary keys? No conflict ?
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6976864
It should be possible using this syntax:

"Select * From Tbl1 Union Select * From Tbl1 IN 'c:\MyFolder\MySecondDatabase.mdb'"

Assuming you have a valid connection to the first database.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 5

Accepted Solution

by:
rkot2000 earned 100 total points
ID: 6977389
I think TimCottee's solution is working only with dao.
link tables is better solution.


0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6977514
This solution works both with DAO and ADO rkot2000. Alternatively you could use a linked table or even a query which does it in access and then use the query as a table source in your VB application. Personally I would stick with the method I show.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7013163
Was that the right comment to accept? If so fine!
0

Featured Post

Independent Software Vendors: 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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

617 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