Solved

Import a JPG picture into Access by Command or ?

Posted on 2004-08-26
6
364 Views
Last Modified: 2012-05-05
I have a Access 97 Database with a Field Name as a OLE Object that is attached to a form.  A single picture will be put on a floppy and I need to be able through a macro or command import the picture to the record that the form is on and attach to the field.  Any Help would be greatly appreciated.

Mike
0
Comment
Question by:Flavio_00
  • 3
  • 2
6 Comments
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 125 total points
ID: 11910012
Don't do it. Importing a picture into a field will result in HUGE database bloat, since Access will essentially decompress your JPG file inside the OLE field. A 30K JPEG file can result in your DB increasing in size by 1MB!!

Instead, copy the picture to a specified location, save the picture's path in the record, and use an Image control on your form. You can set the control to show the picture by using its Picture property.
0
 
LVL 5

Expert Comment

by:Emanon_Consulting
ID: 11910258
MS Access has issues with storing .jpg images in an OLE object field.

Here's a link to a MS Article that covers the Bloating effect of storing images and how to store the file path to the image instead.
http://support.microsoft.com/default.aspx?scid=kb;en-us;285820&Product=acc2003

And here is a link to Alan Warrens web site that gives another alternative using Binary Long Objects (Blob’s).  Good sample here.
http://www.cashoz.com/samples/blobs.asp

Check out this post to get the FilePicker to pick the image.
http://www.experts-exchange.com/Databases/MS_Access/Q_21095227.html


Questions?

Cheers
Michael
0
 

Author Comment

by:Flavio_00
ID: 11927857
Those links never came up.  Here is a little more background of the program.  It is for a Law Enforcement Agency and it is an arrest booking program.  The pictures are going to be a mug shot.  As of right now there shouldn't be to many files on it and they do not need to be archived.  Each officer will use this program on there laptops and will not be centralized.  They use a Web Cam to take the pictures most of the officers are not computer literate that is why I need to be able to click a button and have it import the file from floppy to the current record they are working on.  I can use any additional help or comments.  I am keeping it really simple and dummy proof.

Mike
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11927885
If you include a bound OLE object on the form, the user can right-click on it and choose "Insert Object". That might be the simplest way.
0
 

Author Comment

by:Flavio_00
ID: 11928106
Would there be a way to code a button to automatically import the pic on the floppy into the form.  They floppy will only contain 1 pic and it is in jpg format
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11928159
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now