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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
Pictures/Images in Tables
Use an update query to change the path to the image folder.
Steve "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. |
#3
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|