By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,849 Members | 2,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,849 IT Pros & Developers. It's quick & easy.

Relative Paths for Graphics

P: n/a
I have an Access 2000 database in which I display various graphics for
each record. I store all the images in a folder ("Images") which is a
subdirectory to the directory in which the .mdb is stored. In the table
("Aircraft") behind my form, I have a field in which I store the path
to the image to be displayed for each record.

This works fine, until I move the database (and associated Images
folder) to someone else's machine for a demo. Unless I install the
database with the exact same path for the database and images, the
images won't display because the absolute path that's stored in the
Image_Path field doesn't exist on the new machine.

Is there a way to specify the path to the image as a relative path?
I've tried storing it as "/Images/picture1.jpg" and
"./Images/picture1.jpg" but these don't work. Using relative paths
would make my database very conveniently portable.

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 15 Dec 2004 15:00:41 -0800, ol**********@yahoo.com wrote:

Don't use / in paths in Windows applications. \ is the standard.
I would concatenate a dynamic base path with a fixed sub-path from the
table. Remember that CurrentDb.Name gives you the full path to the
front-end. In the table, only store the name of the image. Then
something like this:
strImagePath = CurrentDb.Name & "\mysubdir\" &
myRecordset!myImageFilenameField
would get you the full path to the image.

-Tom.
I have an Access 2000 database in which I display various graphics for
each record. I store all the images in a folder ("Images") which is a
subdirectory to the directory in which the .mdb is stored. In the table
("Aircraft") behind my form, I have a field in which I store the path
to the image to be displayed for each record.

This works fine, until I move the database (and associated Images
folder) to someone else's machine for a demo. Unless I install the
database with the exact same path for the database and images, the
images won't display because the absolute path that's stored in the
Image_Path field doesn't exist on the new machine.

Is there a way to specify the path to the image as a relative path?
I've tried storing it as "/Images/picture1.jpg" and
"./Images/picture1.jpg" but these don't work. Using relative paths
would make my database very conveniently portable.


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.