Solved

Fetch drive letter

Posted on 2013-06-21
3
334 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
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…
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