Solved

Loading Images into a Database and writing to Disk

Posted on 2010-11-19
4
649 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
  • 2
4 Comments
 
LVL 84

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

726 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