Solved

Accessing another access database from access

Posted on 2008-10-03
4
217 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
  • 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 - Access MVP) earned 500 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now