Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

Fetch drive letter

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
sbs_svendborg
Asked:
sbs_svendborg
1 Solution
 
Gustav BrockCIOCommented:
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
 
Bill RossCommented:
Hi,

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

Regards,

Bill
0
 
sbs_svendborgAuthor Commented:
Excellent :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now