?
Solved

Loading Images into a Database and writing to Disk

Posted on 2010-11-19
4
Medium Priority
?
654 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

752 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