Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Accessing another access database from access

Posted on 2008-10-03
4
Medium Priority
?
227 Views
Last Modified: 2013-11-28
OK, pretty simple I think.  I have a split DB with a FE (front-end) and a BE (back-end) database (thanks to some help in a previous question).

Now in the front end application I want to do the following:

When the main form opens, query the BE database and see if the latest record in the VERSIONS table matches my "hard coded" version in the FE.  If so, display a button and have it execute a query to update the BE db, etc, etc.

So, I know how to do just about all of it accept access that external database.  i know the code is something like this:

Dim db As Database
Set db = OpenDatabase(MyDB)
db.Execute "ALTER TABLE patient ADD COLUMN pMiddleName Text"

The DB is located in the SAME directory as the FE database, but I assume "MyDB" needs to be an absolute path, so I was looking for a function like Server.MapPath (a .asp function) - since I know it is in the same directory, but I won;t always know the absolute path.
0
Comment
Question by:turbosig
[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
  • 3
4 Comments
 
LVL 75
ID: 22638489
Currentproject.Path

will give you the path of the CurrentDB.

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 22638495


Set db = OpenDatabase(Currentproject.Path & "/" & MyDB)

mx
0
 
LVL 2

Author Closing Comment

by:turbosig
ID: 31502940
AAHHH thank you, that did it.  
0
 
LVL 75
ID: 22638524
you are welcome.

mx
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

705 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