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

x
?
Solved

working with 2 datafiles

Posted on 2002-07-12
4
Medium Priority
?
178 Views
Last Modified: 2010-05-03
in my application i need to get a query that join 2 tables from 2 different datafiles,
i have main.mdb that i use to store employees data
and common.mdb that has list and values
i fill the caode in data.mdb tables but the code and  description is in common.mdb
now i want to show on a datagrid, one of the tables from main.mdb, but i want to display the code and description
the code is in main.mdb and description is in common.mdb ?
how can i do that ?
Does attaching the tables from common.mdb to data.mdb solve the problem or any other better answer ?????????
i use MS Access 2000 and VB6.0 on Win98SE
note that : the main.mdb and common.mdb could be installed to different locations, and location of common.mdb could change any time.

0
Comment
Question by:raed
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 7149026
You have two choices, you can either create linked tables in main.mdb to the real tables in common.mdb and treat them as if they were always in main (access handles updating, selecting etc). Or you can use the IN clause to specify an alternate mdb to retrieve data from:

Select MainTable.*,CommonTable.* From Main Inner Join Common IN 'c:\myfolder\common.mdb' On MainTable.Key = CommonTable.Key

However you need to know where common.mdb is at all times, this could be stored in the registry or some other place where you can retrieve the current location when required so your statement would become:

"Select MainTable.*,CommonTable.* From Main Inner Join Common IN '" & strCommonMDBPath & "' On MainTable.Key = CommonTable.Key

Where strCommonMDBPath contains the full path and filename of the common mdb.
0
 

Author Comment

by:raed
ID: 7152024
which is better , i think i m using the first way now but i wanted to be sure,
i need always to reattach the linked tables , i used reattach procedure it worked on Access97 but on 2000 it give lot of problem, is ther a good reattachment function any where i can use,,, for MS Access 2000 ?

thanx alot
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8002368
Hi raed,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

raed, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8095359
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
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…
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…
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…
Suggested Courses

971 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