Solved

Accessing Two mdb files

Posted on 2000-03-13
5
260 Views
Last Modified: 2008-02-01
Hi,
    Can i get  infomations from diffrent .mdb files to fill to a form.  For example, i want to takes informations from table A  where the contents have same value as those from table B. Both tables must  from DIFFRENT mdb files.
 
0
Comment
Question by:thg
[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 2

Expert Comment

by:johnny6
ID: 2614681
thg:
    Open both databases and both tables and perform an inner join on them.  If you need help on how to do this let me know.


John
0
 
LVL 2

Expert Comment

by:idorey
ID: 2614754
Erm..

Perhaps you could just open both databse files and access them??

Seems that you dont really need anything else, just to open and access 2 mdb files at the same time.
0
 
LVL 1

Expert Comment

by:alfaromeo
ID: 2614756
Have u used data controls? This is the easiest way to do it.

1. Create 2 data controls  - associate one with each database(table or SQL query)

2. Use an ADO Data control on the form

3. Associate each form control with the respective data control.

Bingo!

0
 
LVL 1

Expert Comment

by:avitalk
ID: 2615224
how about creating a table link in one database to the other.

that way you can do a query that uses both tables.

Avital
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 60 total points
ID: 2615298
Use the IN Clause in your select statement:

Create a connection to db A, using ADO this might be:

Dim cnnMDBA As ADODB.Connection
Dim rstSelect As ADODB.Recordset
Set cnnMDBA = New ADODB.Connection
Set rstSelect As New ADODB.Recordset
cnnMDBA.ConnectionString = "Provider=....;Data Source = <DatabaseA.MDB>"
cnnMDBA.Open
rstSelect.Open "SELECT A.Name,A.Number,B.Name,B.Number FROM <TableA> A,<TableB> In '<DatabaseB.MDB>' B Where A.Number = B.Number",cnnMDBA,adOpenStatic,adOpenLockOptimistic
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

752 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