Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Home > Forums > Access Forum > Relative file paths by Anna Koldeweij
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Relative file paths
Anna Koldeweij 

2 years ago
Hi Richard!
I am making a database containing a lot of photographed art works, and I would like to be able to use the database on different systems.
Is it possible to use relative file paths in the database? It does not appear to work, and an online search did not turn up a good solution.
It seems only absolute file paths to images are possible. When I take the database with me on a USB thumb drive, the drive letter often changes when I plug it in on a different system, and the links to the images will then be broken.
Ideally, the database would be in a parent folder, which would also contain subfolders with the linked images in it, and this whole parent folder would be portable to other systems. Do you have any suggestions on how to achieve this?
Thanks!
Juan C Rivera  @Reply  
            
2 years ago
What you need to do is set up a system value and you will need to change it as needed.  this will tell Access were to look.  
Richard shows this in the ABCD he did a SystemValueT  the table has 3 fields ID Description and Systemvalue.
He later showed the global mod with the following code.  Not sure that this will work with a USB but you will need to change the information and probably exit and restart the database.

Function GetSystemFolder() As String
      GetSystemFolder = GetSystemValue("SystemFolder")
      If GetSystemFolder = "" Then GetSystemFolder = Application.CurrentProject.Path
End Function

Function GetSystemValue(Description As String) As String
      GetSystemValue = Nz(DLookup("SystemValue", "SystemValueT", "Description=""" & Description & """"), "")
End Function


Hope this leads you in the right direction.
Kevin Yip  @Reply  
      
2 years ago
Relative paths only work if the absolute path of the parent folder is known.  If your drive letter keeps changing, you need to find what that drive letter is before any of your paths can work.  One way is to use VBA to loop through all the drive letters ("C" to "Z") and use the Dir() function to check the path you are looking for using that drive letter exists.  Watch out for identical paths in different drives.  You may have both G:\Myfolder\Myfile.accdb and K:\Myfolder\Myfile.accdb as valid paths, but only K is your thumb drive, for instance.
Kevin Yip  @Reply  
      
2 years ago
There is a way in Windows to manually assign drive letters to drives so they won't be changed.  Open File Explorer, right-click on "My PC," and click Manage.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/16/2026 1:16:53 AM. PLT: 1s