PC Review


Reply
Thread Tools Rate Thread

db using photos - where to keep the photos

 
 
=?Utf-8?B?U3RldmUgRA==?=
Guest
Posts: n/a
 
      27th Feb 2006
all my records will contain photos of the product. it has been suggested to
me that it would be better file management to put all the images in folder
underneath the application folder.

That's the concept - don't store the image in the database but rather the
"relative" path to the image. You don't want to store an absolute path like
"c:\images" - this will break if you move the database and that directory
doesn't exist.

Instead make the folder under the folder where your app runs. i have done
this but the images do not appear in the form when i open it.

need some extra help.
--
Thanks,
Steve D
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2Vybm93IEdpcmw=?=
Guest
Posts: n/a
 
      27th Feb 2006
Hi Steve - don't take this the wrong way but were the pictures already linked
when you altered the location? If so, have you re-linked them.

"Steve D" wrote:

> all my records will contain photos of the product. it has been suggested to
> me that it would be better file management to put all the images in folder
> underneath the application folder.
>
> That's the concept - don't store the image in the database but rather the
> "relative" path to the image. You don't want to store an absolute path like
> "c:\images" - this will break if you move the database and that directory
> doesn't exist.
>
> Instead make the folder under the folder where your app runs. i have done
> this but the images do not appear in the form when i open it.
>
> need some extra help.
> --
> Thanks,
> Steve D

 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      27th Feb 2006
The issue isn't really with the C: drive, but rather with network drives.
If this database and the photos folder are to reside on your local hard
drive I see no problem with referring to c:\images in your link. For
network drives you would use what I believe is known as the Universal Naming
Convention, or UNC. If you insert a hyperlink and drill down through
Network Neighborhood you can see the exact path.
As to not storing them in the database, that is correct. For reasons that
have been discussed extensively elsewhere, the database bloats out of
proportion to the size of the images.

"Steve D" <(E-Mail Removed)> wrote in message
news:0E510102-1DF5-42F6-9E96-(E-Mail Removed)...
> all my records will contain photos of the product. it has been suggested
> to
> me that it would be better file management to put all the images in folder
> underneath the application folder.
>
> That's the concept - don't store the image in the database but rather the
> "relative" path to the image. You don't want to store an absolute path
> like
> "c:\images" - this will break if you move the database and that directory
> doesn't exist.
>
> Instead make the folder under the folder where your app runs. i have done
> this but the images do not appear in the form when i open it.
>
> need some extra help.
> --
> Thanks,
> Steve D



 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      27th Feb 2006
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "Pictures.mdb" which illustrates how to do this.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L


"Steve D" <(E-Mail Removed)> wrote in message
news:0E510102-1DF5-42F6-9E96-(E-Mail Removed)...
> all my records will contain photos of the product. it has been suggested

to
> me that it would be better file management to put all the images in folder
> underneath the application folder.
>
> That's the concept - don't store the image in the database but rather the
> "relative" path to the image. You don't want to store an absolute path

like
> "c:\images" - this will break if you move the database and that directory
> doesn't exist.
>
> Instead make the folder under the folder where your app runs. i have done
> this but the images do not appear in the form when i open it.
>
> need some extra help.
> --
> Thanks,
> Steve D



 
Reply With Quote
 
bob
Guest
Posts: n/a
 
      27th Feb 2006


If you use a relative path then you can access the database via a local drive, UNC path or mapped drive
and it will always find the images. You can also move the database and will not need to change anything
(as long as the images move with it). If you need to move the images independently of the database then
you only need to modify the code in one place, rather than changing the path stored in every record. Since
you are not storing duplicated data (the path) in every record the data is better normalized.

This code assumes that the image files are stored in a subdirectory images relative to the location of
the mdb file.

Private Sub Form_Current()

Dim Path As String
Path = CurrentProject.Path & "\images\" & Me![Filename]

If Me![Filename] <> "" And Len(Dir(Path)) > 0 Then
Me![PicCtrl].Picture = Path
Else
Me![PicCtrl].Picture = ""
End If

End Sub

Filename = name of field containing image filename (eg 1234.jpg)
PicCtrl = name of an image control on the form.

This code is intended for Access 2k and later. For earlier versions an alternative method must be used
to get the path to the database.

--
_______________________________________________________
DBPix 2.0: Add pictures to Access, Easily & Efficiently
http://www.ammara.com/dbpix/access.html




"=?Utf-8?B?U3RldmUgRA==?=" <(E-Mail Removed)> wrote:
>all my records will contain photos of the product. it has been suggested to
>me that it would be better file management to put all the images in folder
>underneath the application folder.
>
>That's the concept - don't store the image in the database but rather the
>"relative" path to the image. You don't want to store an absolute path like
>"c:\images" - this will break if you move the database and that directory
>doesn't exist.
>
>Instead make the folder under the folder where your app runs. i have done
>this but the images do not appear in the form when i open it.
>
>need some extra help.
>--
>Thanks,
>Steve D


 
Reply With Quote
 
=?Utf-8?B?U3RldmUgRA==?=
Guest
Posts: n/a
 
      27th Feb 2006
dear all - thank you so much for your input. i am looking forward to
implementing this into my db. it's a rather high profile project that i have
taken on for another dept in my organization. since this is my first
experience using images as such it's a little confusing but i will wade
through all the info you folks have shared and hopefully get this going.
--
Thanks,
Steve D


"bob" wrote:

>
>
> If you use a relative path then you can access the database via a local drive, UNC path or mapped drive
> and it will always find the images. You can also move the database and will not need to change anything
> (as long as the images move with it). If you need to move the images independently of the database then
> you only need to modify the code in one place, rather than changing the path stored in every record. Since
> you are not storing duplicated data (the path) in every record the data is better normalized.
>
> This code assumes that the image files are stored in a subdirectory ‘images’ relative to the location of
> the mdb file.
>
> Private Sub Form_Current()
>
> Dim Path As String
> Path = CurrentProject.Path & "\images\" & Me![Filename]
>
> If Me![Filename] <> "" And Len(Dir(Path)) > 0 Then
> Me![PicCtrl].Picture = Path
> Else
> Me![PicCtrl].Picture = ""
> End If
>
> End Sub
>
> Filename = name of field containing image filename (eg “1234.jpg”)
> PicCtrl = name of an image control on the form.
>
> This code is intended for Access 2k and later. For earlier versions an alternative method must be used
> to get the path to the database.
>
> --
> _______________________________________________________
> DBPix 2.0: Add pictures to Access, Easily & Efficiently
> http://www.ammara.com/dbpix/access.html
>
>
>
>
> "=?Utf-8?B?U3RldmUgRA==?=" <(E-Mail Removed)> wrote:
> >all my records will contain photos of the product. it has been suggested to
> >me that it would be better file management to put all the images in folder
> >underneath the application folder.
> >
> >That's the concept - don't store the image in the database but rather the
> >"relative" path to the image. You don't want to store an absolute path like
> >"c:\images" - this will break if you move the database and that directory
> >doesn't exist.
> >
> >Instead make the folder under the folder where your app runs. i have done
> >this but the images do not appear in the form when i open it.
> >
> >need some extra help.
> >--
> >Thanks,
> >Steve D

>
>

 
Reply With Quote
 
bob
Guest
Posts: n/a
 
      27th Feb 2006


You'll probably also want to take a look at this article to avoid the 'Loading Image' dialog and the crash
that goes with it:

http://www.mvps.org/access/api/api0038.htm

--
_______________________________________________________
DBPix 2.0: Add pictures to Access, Easily & Efficiently
http://www.ammara.com/dbpix/access.html


"=?Utf-8?B?U3RldmUgRA==?=" <(E-Mail Removed)> wrote:
>dear all - thank you so much for your input. i am looking forward to
>implementing this into my db. it's a rather high profile project that i have
>taken on for another dept in my organization. since this is my first
>experience using images as such it's a little confusing but i will wade
>through all the info you folks have shared and hopefully get this going.
>--
>Thanks,
>Steve D
>
>
>"bob" wrote:
>
>>
>>
>> If you use a relative path then you can access the database via a local drive, UNC path or mapped drive
>> and it will always find the images. You can also move the database and will not need to change anything
>> (as long as the images move with it). If you need to move the images independently of the database

then
>> you only need to modify the code in one place, rather than changing the path stored in every record.

Since
>> you are not storing duplicated data (the path) in every record the data is better normalized.
>>
>> This code assumes that the image files are stored in a subdirectory ‘images’ relative to the location

of
>> the mdb file.
>>
>> Private Sub Form_Current()
>>
>> Dim Path As String
>> Path = CurrentProject.Path & "\images\" & Me![Filename]
>>
>> If Me![Filename] <> "" And Len(Dir(Path)) > 0 Then
>> Me![PicCtrl].Picture = Path
>> Else
>> Me![PicCtrl].Picture = ""
>> End If
>>
>> End Sub
>>
>> Filename = name of field containing image filename (eg “1234.jpg”)
>> PicCtrl = name of an image control on the form.
>>
>> This code is intended for Access 2k and later. For earlier versions an alternative method must be used
>> to get the path to the database.
>>
>> --
>> _______________________________________________________
>> DBPix 2.0: Add pictures to Access, Easily & Efficiently
>> http://www.ammara.com/dbpix/access.html
>>
>>
>>
>>
>> "=?Utf-8?B?U3RldmUgRA==?=" <(E-Mail Removed)> wrote:
>> >all my records will contain photos of the product. it has been suggested to
>> >me that it would be better file management to put all the images in folder
>> >underneath the application folder.
>> >
>> >That's the concept - don't store the image in the database but rather the
>> >"relative" path to the image. You don't want to store an absolute path like
>> >"c:\images" - this will break if you move the database and that directory
>> >doesn't exist.
>> >
>> >Instead make the folder under the folder where your app runs. i have done
>> >this but the images do not appear in the form when i open it.
>> >
>> >need some extra help.
>> >--
>> >Thanks,
>> >Steve D

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slide show photos much darker than original photos. Help me fix th Miguel Windows XP MovieMaker 0 21st Feb 2009 09:48 PM
Report w/photos consumes memory - photos blank CDev Microsoft Access Reports 0 12th Nov 2008 09:09 PM
no attachment icon with photos/can't copy & paste photos onehotmama Microsoft Outlook Discussion 1 25th Jun 2008 07:44 PM
Scanning photos onto one's hard drive - why are the photos clearerthan the scan Patrick Briggs Scanners 6 21st Feb 2006 06:16 PM
e-mailing photos from photos folder - size reduction =?Utf-8?B?TWFyYw==?= Windows XP Photos 12 18th May 2005 06:30 AM


Features
 

Advertising
 

Newsgroups
 


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