Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 1st, 2007, 04:48 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Photo in Access table

I have to develop project information db in access.
table is following

project_id text pk
project _name text

I want to store the photo information before the start of project
and after completion the project.
which data type will use ?
phot_before and photo_after OLE_OBJECT datatype will use ?

How can store the photo/image file name and folder path in the table ?
access form can create for photo data entry ?

Please help

Old November 1st, 2007, 07:55 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

The issue is, do you want to store the image IN Access, or just a link to the image.

If you want the photo in Access, then use the OLE DB data type, and when you add the control to a form, there will be options to import an image (right click on the control.) This will very quickly result in a very large database, and you will need to split it (front end, back end for data, back end for before photos, back end for after photos, etc).

You can also store the path to image files, which takes up much less space, although everyone who accesses the database will need to be mapped to the network storage location with the same drive letter, etc. This would be the case with a split database as above.

I did a search at Microsoft.com for this and came up with:

Use VBA code to display images
If you need to work with a large number of image files and you want to display a different image with each database record, using some VBA programming can save you time and storage space. You store your images on your hard drive or network, store the paths and file names of your images in a text field in your database, and then use VBA code to read the path information and set the Picture property of the Access image control.

Keep in mind that this process links to your image files — it does not bind them. Also, if you move your database, you also need to move your images. To see an example of this technique, start the Northwind Traders sample database and open the Employees form in Design view.

Open the table to which you want to add the field in Design view .
In the first blank row of the design tool, under Field Name, enter Image.
Click the next field (the field in the Data Type column), and select Text from the list.
Save the table.
Follow the instructions in this Microsoft Knowledge Base article:
How to display images from a folder in a form, a report, or a data access page

Caution Your database users can view the paths to your image files. Unless you trust all possible users, remove any personal information, such as your name or the name of your computer, from the file paths. Also keep in mind that you can use relative paths to refer to pictures.

For example, if you place your database on a network, such as \\ServerName\ShareName\, and store your images in a folder on that share, such as \\ServerName\ShareName\Pictures, you don't have to specify the entire path.

So, instead of using \\ServerName\ShareName\Pictures\Picture.gif, you can use only the portion of the path that is different, relative to the location of the current Access file, like this: Pictures\Picture.gif.

From: http://office.microsoft.com/en-us/ac...802251033.aspx

Did that help?


Look it up at: http://wrox.books24x7.com
Old November 2nd, 2007, 08:48 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks you very much.
I realy appreciate your details response.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error posting photo to photo album abel714 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 10 February 5th, 2007 03:07 AM
Photo software malambing57 ASP.NET 1.0 and 1.1 Professional 1 January 9th, 2007 11:50 AM
Wrox Photo Album Help rsearing BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 6 September 27th, 2006 02:30 PM
Display 'no photo' in a JSP when photo is not pres Inderjeet Pro JSP 0 April 21st, 2006 05:35 AM
fading from photo to photo in flash elladi Flash (all versions) 1 November 28th, 2004 11:21 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.