Solved

Fetch drive letter

Posted on 2013-06-21
3
335 Views
Last Modified: 2013-06-21
I have a MS Access database, with references to external JPG's.
The database is to be located on a USB stick in the root of the stick.

I have a form, in the DB, and when it loads it would be smart if is also read on which drive dv DB was located.
I'm programming it in vb.net.

How do I make Access figure out on what drive letter the database is located?
0
Comment
Question by:sbs_svendborg
3 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39265243
The DOS syntax for "current path" is ".\".

So if your pictures are in subfolder Images of the current drive\folder, you can refer to it with:

strImagePath = ".\Images"

/gustav
0
 
LVL 14

Accepted Solution

by:
Bill Ross earned 500 total points
ID: 39265582
Hi,

Try this:
dim MyDBDrive as string
MyDBDrive=left(currentdb.Name,3)

Regards,

Bill
0
 

Author Closing Comment

by:sbs_svendborg
ID: 39265639
Excellent :-)
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

864 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

19 Experts available now in Live!

Get 1:1 Help Now