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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Pictures/Images in Tables



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2009, 01:59 PM posted to microsoft.public.access.tablesdbdesign
adrian007uk
external usenet poster
 
Posts: 67
Default Pictures/Images in Tables

I have read up on best practice conerning displaying images in a database.

I am planning to link the images from my PC. What i would like to know is
if the location of ther folder where the images are stotred changes (e.g.,
from 'C' to 'D') is there any way it can be changed within the database
quicly without having to change every image location as well?

Thanks in advance for any suggestions.
  #3  
Old June 30th, 2009, 03:37 PM posted to microsoft.public.access.tablesdbdesign
fredg
external usenet poster
 
Posts: 4,386
Default Pictures/Images in Tables

On Tue, 30 Jun 2009 05:59:01 -0700, adrian007uk wrote:

I have read up on best practice conerning displaying images in a database.

I am planning to link the images from my PC. What i would like to know is
if the location of ther folder where the images are stotred changes (e.g.,
from 'C' to 'D') is there any way it can be changed within the database
quicly without having to change every image location as well?

Thanks in advance for any suggestions.


You post is not clear.
Do you mean you are storing the pictures in "C:\My Folder"
and (correctly) storing just the above path to the image in your
database?

If so, you can run an update query to change the drive designation.

Update MyTable Set MyTable.[Path] = "D" & Mid([Path],2) Where
Left([Path],1) = "C"

The above will change "C\My Folder" to "D:\My Folder" for all records.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old June 30th, 2009, 08:02 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Pictures/Images in Tables

On Tue, 30 Jun 2009 05:59:01 -0700, adrian007uk
wrote:

I have read up on best practice conerning displaying images in a database.

I am planning to link the images from my PC. What i would like to know is
if the location of ther folder where the images are stotred changes (e.g.,
from 'C' to 'D') is there any way it can be changed within the database
quicly without having to change every image location as well?

Thanks in advance for any suggestions.


What you might want to do is store JUST the filename (IMG3122.jpg say) in the
text field in your database, and have a separate, single-row table tblFolder
with just one field, Folder (e.g. "C:\Documents and Settings\Adrian\My
Pictures\"). Then in the code that displays the picture you can concatenate
the two fields.

When the path changes you will then need to just edit the one field in
tblFolders.

Alternatively you can run an Update query updating all the records in your
images table:

UPDATE Images SET filename = Replace([filename], "C:/", "D:/")
--

John W. Vinson [MVP]
  #5  
Old July 1st, 2009, 08:01 AM posted to microsoft.public.access.tablesdbdesign
adrian007uk
external usenet poster
 
Posts: 67
Default Pictures/Images in Tables

Hi Fredg

Thanks for your comments.

Sorry my post was unclear. Yes, if i created the database that pointed to
images on 'C' and say in six months i moved that folder to 'D', what would
the best way to design the database so this change would be quickly
implemented? I guess if i did not think in advance of this issue i may have
to go through every image and point it to the new location.

"fredg" wrote:

On Tue, 30 Jun 2009 05:59:01 -0700, adrian007uk wrote:

I have read up on best practice conerning displaying images in a database.

I am planning to link the images from my PC. What i would like to know is
if the location of ther folder where the images are stotred changes (e.g.,
from 'C' to 'D') is there any way it can be changed within the database
quicly without having to change every image location as well?

Thanks in advance for any suggestions.


You post is not clear.
Do you mean you are storing the pictures in "C:\My Folder"
and (correctly) storing just the above path to the image in your
database?

If so, you can run an update query to change the drive designation.

Update MyTable Set MyTable.[Path] = "D" & Mid([Path],2) Where
Left([Path],1) = "C"

The above will change "C\My Folder" to "D:\My Folder" for all records.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

  #6  
Old July 1st, 2009, 08:08 AM posted to microsoft.public.access.tablesdbdesign
adrian007uk
external usenet poster
 
Posts: 67
Default Pictures/Images in Tables

Thanks John

Fred and yourself has given me somethings to think about. I will need to do
some more reading up on your suggestions as am still slightly confused as to
how i can implement them (I am quite new to access).

Adrian

"John W. Vinson" wrote:

On Tue, 30 Jun 2009 05:59:01 -0700, adrian007uk
wrote:

I have read up on best practice conerning displaying images in a database.

I am planning to link the images from my PC. What i would like to know is
if the location of ther folder where the images are stotred changes (e.g.,
from 'C' to 'D') is there any way it can be changed within the database
quicly without having to change every image location as well?

Thanks in advance for any suggestions.


What you might want to do is store JUST the filename (IMG3122.jpg say) in the
text field in your database, and have a separate, single-row table tblFolder
with just one field, Folder (e.g. "C:\Documents and Settings\Adrian\My
Pictures\"). Then in the code that displays the picture you can concatenate
the two fields.

When the path changes you will then need to just edit the one field in
tblFolders.

Alternatively you can run an Update query updating all the records in your
images table:

UPDATE Images SET filename = Replace([filename], "C:/", "D:/")
--

John W. Vinson [MVP]

  #7  
Old July 1st, 2009, 02:45 PM posted to microsoft.public.access.tablesdbdesign
Fred
external usenet poster
 
Posts: 1,451
Default Pictures/Images in Tables

My main qualification here is that I only know 1/10 th as much as John.

Here's how this mere mortal does it: We have two fields in the table
relevant to this: (shorten my long names)

PictureFileName Enter the picture file names here

PicturePathAndFile (only loaded by the below query)

And make an update query which updates the PicturePathAndFile field to

"Type in the path here" & [PictureFileName]




  #8  
Old July 1st, 2009, 03:22 PM posted to microsoft.public.access.tablesdbdesign
Keith Wilby
external usenet poster
 
Posts: 812
Default Pictures/Images in Tables

"adrian007uk" wrote in message
...

I have read up on best practice conerning displaying images in a database.

I am planning to link the images from my PC. What i would like to know is
if the location of ther folder where the images are stotred changes (e.g.,
from 'C' to 'D') is there any way it can be changed within the database
quicly without having to change every image location as well?

Thanks in advance for any suggestions.


Just a thought, and I've not tested this so there might be a red herring
element, but if your images are all in the same generic location, eg
X:\MyFolder\MyImages\ ... then you *could* store this location in a lookup
table and use DLookup to return it. So in your query you could have a
calculated field

ImageLocation: DLookup("MyField", "tblMyTable") & [ImageFolder]

where [ImageFolder] is a field to store the " ... " element of
"X:\MyFolder\MyImages\ ... "

.... and if the location changes, say to X:\MyOtherFolder\MyImages\ ...

then you only need change it once in the lookup table.

Keith.
www.keithwilby.co.uk

  #9  
Old July 1st, 2009, 03:27 PM posted to microsoft.public.access.tablesdbdesign
fredg
external usenet poster
 
Posts: 4,386
Default Pictures/Images in Tables

On Wed, 1 Jul 2009 00:01:03 -0700, adrian007uk wrote:

Hi Fredg

Thanks for your comments.

Sorry my post was unclear. Yes, if i created the database that pointed to
images on 'C' and say in six months i moved that folder to 'D', what would
the best way to design the database so this change would be quickly
implemented? I guess if i did not think in advance of this issue i may have
to go through every image and point it to the new location.

"fredg" wrote:

On Tue, 30 Jun 2009 05:59:01 -0700, adrian007uk wrote:

I have read up on best practice conerning displaying images in a database.

I am planning to link the images from my PC. What i would like to know is
if the location of ther folder where the images are stotred changes (e.g.,
from 'C' to 'D') is there any way it can be changed within the database
quicly without having to change every image location as well?

Thanks in advance for any suggestions.


You post is not clear.
Do you mean you are storing the pictures in "C:\My Folder"
and (correctly) storing just the above path to the image in your
database?

If so, you can run an update query to change the drive designation.

Update MyTable Set MyTable.[Path] = "D" & Mid([Path],2) Where
Left([Path],1) = "C"

The above will change "C\My Folder" to "D:\My Folder" for all records.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


Both John and I have given you correct answers. Take your pick.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #10  
Old July 2nd, 2009, 01:13 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Pictures/Images in Tables

On Wed, 1 Jul 2009 00:08:01 -0700, adrian007uk
wrote:

Thanks John

Fred and yourself has given me somethings to think about. I will need to do
some more reading up on your suggestions as am still slightly confused as to
how i can implement them (I am quite new to access).


What is the actual structure of your table?
If you're storing a picture filename in a text field in a table, HOW are you
storing it - just as "IMG3145.jpg" or are you including the path?
How are you getting pictures into the image control? Please post your code.
--

John W. Vinson [MVP]
 




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


All times are GMT +1. The time now is 05:47 AM.


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