Solved

Loading Images into a Database and writing to Disk

Posted on 2010-11-19
4
651 Views
Last Modified: 2012-06-27
I would like to know how to load an image from disk to a table in Access and when needed how to write that image back to the file system.
I want to store images in a table within Access 2010 in case my users delete or rename various graphic images from the file system. These images include the program icon and several images that are used for reporting.
Upon startup, I would like my application to check if these images have been moved, renamed, or deleted and write them back to the disk if needed.
As a side benefit, this type of solution would also allow me to version-control these images instead of using the file system. (I probably would only include the latest images in my distribution to users).
This is for a single-user application that is distributed nationally to individual users via front and back-end executable (.accde) programs.
I know that storing images in a database can use a lot of space, but that is not the issue to be addressed in this question. There are only 5 images that needs to addressed in this manner.
Thanks.
0
Comment
Question by:RCUllrich
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 34174231
2010 includes the Attachment field, which can be used to store your images.

Here's a blog post about using VBA to work with items stored in an Attachment field:
http://blogs.msdn.com/b/access/archive/2007/08/24/adding-removing-and-saving-files-from-the-new-attachment-field-in-access-2007.aspx

Here's some info about the Attachment fieldtype:
http://www.databasedev.co.uk/access2007attachment.html
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34176325

<No Points wanted>

    "I would like my application to check if these images have been moved, renamed, or deleted and write them back to the disk if needed."

Why not simply only allow Read permissions to the Image folder? (Denying all other permissions)
In this way, checking the validity of the images should be rare occurrence.

JeffCoachman
0
 
LVL 3

Author Comment

by:RCUllrich
ID: 34179636
LSMConsulting: Thanks for the information regarding the new features in Access 2007 and Access 2010. I just concluded a week where I worked 60 hours for a client and have not had a time to test the new "Attachment" feature but will soon and award points. That looks like a great feature - I did not read that section of the various referencing I have used for new features.

Jeff - I use SageKey for creating the installation program and will certainly consider setting the permission for my images folder. It does bring up the issue regarding the permissions my program would have to "write" to that location in the event a user removed one of the images. I will need to add error handling code to the program warn that a report is not available if the user has deleted an image used on that report. Thanks!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34183952
OK
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question