Solved

Fetching from 2 MSAccess Databases

Posted on 2002-04-28
6
165 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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 …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

896 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

17 Experts available now in Live!

Get 1:1 Help Now