Solved

Accessing another access database from access

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

734 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