Solved

Accessing Two mdb files

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA combine two working workbooks 8 62
How to debug this code 7 64
Access 2013 combo box not working 3 51
Publisher:   Unknown     VB.exe Application 1 28
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

820 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