Solved

Accessing another access database from access

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

912 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

22 Experts available now in Live!

Get 1:1 Help Now