Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Fetch drive letter

Posted on 2013-06-21
3
Medium Priority
?
352 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 52

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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

604 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