Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Accessing Two mdb files

Posted on 2000-03-13
5
Medium Priority
?
273 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 120 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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

877 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