A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Relative path vs. absolute path possible in storing pictures?



 
 
Thread Tools Display Modes
  #1  
Old November 26th, 2005, 12:21 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Relative path vs. absolute path possible in storing pictures?

Every db I've made up till now in FMP has had few pix so I've just stored
them in the db itself. Now FMP frowns on this as much as A2K you
understand! grin But there were so few pictures, it didn't hurt.

The current A2K db I'm creating will have potentially a picture for each
record so it will be necessary this time around to just reference each. I
have a problem with absolute paths, however. When one decides to re-locate
a db, the pictures would no longer work if absolutes are used. Can we use
relative ones in A2K even when choosing the picture? I found an example db
that does this while explaining the procedure and after pressing the button
and choosing the graphic, the picture appears in a large box, while a
rectangular box underneath displays the complete path. Here are the
instructions from that example db:

"
It is usually preferable NOT to store OLE objects like pictures in the table
itself. It causes massive database bloat. The usual solution is to store
the pictures as files on the hard drive and store the file name in the
table. This sample demonstrates how to use the OpenSaveFile API to find the
picture file you want loaded into the database.

By default, it starts looking in the same directory as where the application
resides. If you want to change that, change this line:
pathname = CurrentProject.Path
to the path you want:
pathname = "C:\My Documents"
"

If I have a folder on the desktop called, say, "Movie Database" that has an
A2K file called "My Movie Database.mdb" and a folder called "images" for the
pictures, can A2K be made to just reference only the images folder along
with the graphics so that behind the scenes we'd just get something like
this: "images\graphic01.jpg" instead of this: "c:\desktop\Movie
Database\images\graphic01.jpg" which wouldn't work once we moved the mdg
files and images to, say, somewhere my D drive?

Thanks so much. D


  #2  
Old November 26th, 2005, 01:15 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Relative path vs. absolute path possible in storing pictures?

Store the name of some "root" folder in a single record in an
"administrative" table of your database. Store the pathname relative
to this root in the each picture's individual record in a different
table. When it comes time to retrieve the picture, concatenate the two
parts to make a full pathname. You could do this with VBA code or with
a query, depending on the structure of your program.




On Fri, 25 Nov 2005 19:21:18 -0500, "StargateFanFromWork"
wrote:

Every db I've made up till now in FMP has had few pix so I've just stored
them in the db itself. Now FMP frowns on this as much as A2K you
understand! grin But there were so few pictures, it didn't hurt.

The current A2K db I'm creating will have potentially a picture for each
record so it will be necessary this time around to just reference each. I
have a problem with absolute paths, however. When one decides to re-locate
a db, the pictures would no longer work if absolutes are used. Can we use
relative ones in A2K even when choosing the picture? I found an example db
that does this while explaining the procedure and after pressing the button
and choosing the graphic, the picture appears in a large box, while a
rectangular box underneath displays the complete path. Here are the
instructions from that example db:

"
It is usually preferable NOT to store OLE objects like pictures in the table
itself. It causes massive database bloat. The usual solution is to store
the pictures as files on the hard drive and store the file name in the
table. This sample demonstrates how to use the OpenSaveFile API to find the
picture file you want loaded into the database.

By default, it starts looking in the same directory as where the application
resides. If you want to change that, change this line:
pathname = CurrentProject.Path
to the path you want:
pathname = "C:\My Documents"
"

If I have a folder on the desktop called, say, "Movie Database" that has an
A2K file called "My Movie Database.mdb" and a folder called "images" for the
pictures, can A2K be made to just reference only the images folder along
with the graphics so that behind the scenes we'd just get something like
this: "images\graphic01.jpg" instead of this: "c:\desktop\Movie
Database\images\graphic01.jpg" which wouldn't work once we moved the mdg
files and images to, say, somewhere my D drive?

Thanks so much. D


**********************

remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
  #3  
Old November 26th, 2005, 01:27 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Relative path vs. absolute path possible in storing pictures?

On Sat, 26 Nov 2005 01:15:19 GMT, jacksonmacd
wrote:

Store the name of some "root" folder in a single record in an
"administrative" table of your database. Store the pathname relative
to this root in the each picture's individual record in a different
table. When it comes time to retrieve the picture, concatenate the two
parts to make a full pathname. You could do this with VBA code or with
a query, depending on the structure of your program.


Oh. Well, I guess I can't do what I initially hoped to do g. I
didn't really understand all of that (lord, it's tough being a rank
newbie again! g). I'll keep this information, though, for when I
know more and can try to figure out how to do what you say. Good to
know that however difficult, there may be a workaround.

All I know is that absolute path are absolutely always a pain in the
butt for me. I often will finetune a folder name for a while until
it's just right and anything that works on absolute paths is always a
pain while that is happening. Then I also like to have working paths
for things I end up transferring to CD. Or how about once I take from
my C drive to the D drive? sigh Not good.

I'm definitely going to hold off putting pictures in, that's for sure!
lol

Thanks.

On Fri, 25 Nov 2005 19:21:18 -0500, "StargateFanFromWork"
wrote:

Every db I've made up till now in FMP has had few pix so I've just stored
them in the db itself. Now FMP frowns on this as much as A2K you
understand! grin But there were so few pictures, it didn't hurt.

The current A2K db I'm creating will have potentially a picture for each
record so it will be necessary this time around to just reference each. I
have a problem with absolute paths, however. When one decides to re-locate
a db, the pictures would no longer work if absolutes are used. Can we use
relative ones in A2K even when choosing the picture? I found an example db
that does this while explaining the procedure and after pressing the button
and choosing the graphic, the picture appears in a large box, while a
rectangular box underneath displays the complete path. Here are the
instructions from that example db:

"
It is usually preferable NOT to store OLE objects like pictures in the table
itself. It causes massive database bloat. The usual solution is to store
the pictures as files on the hard drive and store the file name in the
table. This sample demonstrates how to use the OpenSaveFile API to find the
picture file you want loaded into the database.

By default, it starts looking in the same directory as where the application
resides. If you want to change that, change this line:
pathname = CurrentProject.Path
to the path you want:
pathname = "C:\My Documents"
"

If I have a folder on the desktop called, say, "Movie Database" that has an
A2K file called "My Movie Database.mdb" and a folder called "images" for the
pictures, can A2K be made to just reference only the images folder along
with the graphics so that behind the scenes we'd just get something like
this: "images\graphic01.jpg" instead of this: "c:\desktop\Movie
Database\images\graphic01.jpg" which wouldn't work once we moved the mdg
files and images to, say, somewhere my D drive?

Thanks so much. D


**********************

remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security


  #4  
Old November 26th, 2005, 07:05 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Relative path vs. absolute path possible in storing pictures?



You can certainly use relative paths. As mentioned in your quote, 'CurrentProject.Path' returns the path
to the access mdb itself. Therefore, if you store the images in a subdirectory, for example 'images',
you can simply concatenate CurrentProject.Path, 'images' and the filename (which you presumably have stored
in a table). Then, wherever you move the database, or however you access it (via UNC or share, for example),
the paths will work (provided the images are moved with the database). Note that currenproject.path works
in Access 2000 and later - if you need to support Access 97, use 'CurrentDb.Name' and parse the path out
of it.

--
__________________________________________________ _____
http://www.ammara.com/
Image Handling Components, Samples, Solutions and Info
DBPix 2.0: Add pictures to Access, Easily & Efficiently


"StargateFanFromWork" wrote:
Every db I've made up till now in FMP has had few pix so I've just stored
them in the db itself. Now FMP frowns on this as much as A2K you
understand! grin But there were so few pictures, it didn't hurt.

The current A2K db I'm creating will have potentially a picture for each
record so it will be necessary this time around to just reference each. I
have a problem with absolute paths, however. When one decides to re-locate
a db, the pictures would no longer work if absolutes are used. Can we use
relative ones in A2K even when choosing the picture? I found an example db
that does this while explaining the procedure and after pressing the button
and choosing the graphic, the picture appears in a large box, while a
rectangular box underneath displays the complete path. Here are the
instructions from that example db:

"
It is usually preferable NOT to store OLE objects like pictures in the table
itself. It causes massive database bloat. The usual solution is to store
the pictures as files on the hard drive and store the file name in the
table. This sample demonstrates how to use the OpenSaveFile API to find the
picture file you want loaded into the database.

By default, it starts looking in the same directory as where the application
resides. If you want to change that, change this line:
pathname = CurrentProject.Path
to the path you want:
pathname = "C:\My Documents"
"

If I have a folder on the desktop called, say, "Movie Database" that has an
A2K file called "My Movie Database.mdb" and a folder called "images" for the
pictures, can A2K be made to just reference only the images folder along
with the graphics so that behind the scenes we'd just get something like
this: "images\graphic01.jpg" instead of this: "c:\desktop\Movie
Database\images\graphic01.jpg" which wouldn't work once we moved the mdg
files and images to, say, somewhere my D drive?

Thanks so much. D



  #5  
Old December 2nd, 2005, 04:23 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Relative path vs. absolute path possible in storing pictures?

Bob, what if you want your images to be stored in a folder underneath the
folder where the backend database resides? CurrentProject.Path and CurrentDb.
Name, I presume give you the path to the frontend database, which may reside
on the user's local machine. Is there any way you can access the value of the
path to the linked tables?

LW


Bob wrote:
You can certainly use relative paths. As mentioned in your quote, 'CurrentProject.Path' returns the path
to the access mdb itself. Therefore, if you store the images in a subdirectory, for example 'images',
you can simply concatenate CurrentProject.Path, 'images' and the filename (which you presumably have stored
in a table). Then, wherever you move the database, or however you access it (via UNC or share, for example),
the paths will work (provided the images are moved with the database). Note that currenproject.path works
in Access 2000 and later - if you need to support Access 97, use 'CurrentDb.Name' and parse the path out
of it.

--
_________________________________________________ ______
http://www.ammara.com/
Image Handling Components, Samples, Solutions and Info
DBPix 2.0: Add pictures to Access, Easily & Efficiently

Every db I've made up till now in FMP has had few pix so I've just stored
them in the db itself. Now FMP frowns on this as much as A2K you

[quoted text clipped - 33 lines]

Thanks so much. D


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/200512/1
  #6  
Old December 2nd, 2005, 09:29 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Relative path vs. absolute path possible in storing pictures?



You can get the path to the back-end where a particular linked table resides by using the following:

Mid(CurrentDb().TableDefs("NameOfLinkedTable").Con nect, 11)

(thanks to Doug Steele & Allen Browne)

--
__________________________________________________ _____
http://www.ammara.com/
Image Handling Components, Samples, Solutions and Info
DBPix 2.0: Add Pictures to Access, Easily & Efficiently


"LW via AccessMonster.com" u10097@uwe wrote:
Bob, what if you want your images to be stored in a folder underneath the
folder where the backend database resides? CurrentProject.Path and CurrentDb.
Name, I presume give you the path to the frontend database, which may reside
on the user's local machine. Is there any way you can access the value of the
path to the linked tables?

LW


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use a relative path to link to back-end? Carl Rapson Setting Up & Running Reports 4 February 10th, 2005 03:38 PM
relative path within includetext George Lagger Mailmerge 2 January 27th, 2005 03:15 PM
Making relative references absolute Shari Worksheet Functions 8 June 30th, 2004 06:43 PM
Changing Multiple Cells from Relative to Absolute Functions Gord Dibben Worksheet Functions 1 February 1st, 2004 09:18 PM
Relative vs. Absolute Values in Formulas Worksheet Functions 0 January 22nd, 2004 11:59 PM


All times are GMT +1. The time now is 07:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.