Solved

Accessing Two mdb files

Posted on 2000-03-13
5
264 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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 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…
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 Month10 days, 7 hours left to enroll

632 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