Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Fetching from 2 MSAccess Databases

Posted on 2002-04-28
6
Medium Priority
?
173 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
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!

 
LVL 5

Accepted Solution

by:
rkot2000 earned 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

722 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