Solved

Fetch drive letter

Posted on 2013-06-21
3
339 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
[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 Comments
 
LVL 50

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

728 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