Solved

Accessing another access database from access

Posted on 2008-10-03
4
224 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 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

617 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