Solved

Fetching from 2 MSAccess Databases

Posted on 2002-04-28
6
171 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 100

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 127
Zip Folders Using Chilkat Routines 1 86
Copy a range from 1..n excel sheets to one destination sheet 2 71
add criteria to query in VB, Access 2003 2 48
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…

734 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