?
Solved

Displaying OLE Object images in an Access database form

Posted on 2014-02-04
7
Medium Priority
?
9,327 Views
Last Modified: 2014-02-05
I've been wrangling with this for several days, and now I feel like I'm going in circles.

I have a table in a temporarily inherited Access 2007 database, which contains basic employee details and a PhotoField which stores a photo of each employee as an OLE Object.

As it currently stands the PhotoField is currently populated by 3rd party software used for making ID Badges for the employees.

Now I'm needing to have a bound form in the database, which displays the employee details including the photo.

Unfortunately it is not stored in the standard bitmap format that a bound object frame will happily display on a bound form with the rest of the information, so comes up blank. I've also been unable to get the object into an image control (successful only in linking an external file using the Picture property)

I have written a basic VB.Net application which is using a bound PictureBox control which  recognises and displays the images correctly, so I gather it is stored in an image format not too alien.

Before I go further, I need to say I realise the stupidity of storing these images as OLE Objects when they should be created as files separately and then linked to an image object in the form. That VB.Net application I built is able to export the OLE Objects as jpg's for that very reason.

However, the limited nature of the 3rd Party software which will only store and retrieve the pictures from OLE Objects in that table (for the sake of retrieving data to print the ID Badges), as well as certain politics limiting changing business processes and building a more flexible system, ties my hands somewhat. The common solution provided of exporting those images as files linked to the database aren't applicable unless it can be automated within the database itself (A third application designed for the sake of exporting those images regularly isn't really feasible, especially since when I'm done I will have to hand this back to an overseas office to manage for themselves).

What I guess would be ideal is something equivalent to the .Net PictureBox control that can be found within Access 2007, or added as an ActiveX control, so that it can display the OLE Object visually in an Access Form. Alternatively a means of using the image control to display a non-bitmap image stored within a database table.

Before you throw me a link to Stephen Leban's website, I've already looked through it without much success. I may have missed something on it, so I'm happy to review   relevant code/examples there that you can point me if you have specific details.

Thanks.
0
Comment
Question by:AngusT
[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
7 Comments
 
LVL 15

Expert Comment

by:gplana
ID: 39834678
As this is an OLE Object, you should user an OLE Object control on your application to show it (no bitmap). Also you will have the 3rd party software installed because OLE Object means an object of this kind of file.

If installing 3rd party on all computers that use your application is a problem, another option is to migrate all the ole objects to images.

Hope it helps.
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 39834728
Hello AngusT,

If you open the table in Datasheet View, what are the values you see under PhotoField? Is it Package or Bitmap Image?

Sincerely,

Ed
0
 
LVL 85
ID: 39835368
What image format is used for the picture (i.e. png, jpg, etc)? Office installs some (but not all) "graphic filters" by default, and if it's not a support image type it won't display. I believe only .bmp and .dib types are supported, unless you've installed other filters.

This is for 2003, but would be relevant for any version of Access:

http://office.microsoft.com/en-us/access-help/use-images-in-your-access-forms-reports-and-controls-HA001147204.aspx

Also see this regarding specifics on 2007/2010:

http://support.microsoft.com/kb/2479871/en-us
0
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!

 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 1500 total points
ID: 39835397
<<As it currently stands the PhotoField is currently populated by 3rd party software used for making ID Badges for the employees. >>

Really the problem is your 3rd party software.  It's probably doing something with the image to get around the old OLE bloat problem, which Access now can do on it's own.

 So as Scott said, the first thing is to understand what format the data is saved in, then either using a bound OLE control, or an image control.

 As an aside, you might want to look at:

http://www.ammara.com/dbpix/access.html

 which is the control of choice for dealing with images in Access.

Jim.
0
 

Author Comment

by:AngusT
ID: 39837831
In the datasheet it says 'Long Binary Data', so essentially stored as a BLOB.

The problem is that I don't know what format the data is, but is something recognised by the generic Picturebox Control in .NET applications, so it probably isn't something non-standard...but something that Access doesn't natively recognise. Unlikely to be a bitmap.

I've been through the documentation of the 3rd party software on the possible format of the image, but it gives no clue. It is really just a user and administration guide. I've emailed the customer support in the USA (we have no support contract) to find out, but as yet had no response.

If it is just making a blob from the image that is chosen then it is feasible that it is a jpg, since that is the source photo format. If I choose a bitmap to import, I might see how that works when I can (public holiday in New Zealand and so I can't remote in from Australia to check for another 24 hours).

Any idea if Access can identify a bitmap in a blob if it isn't explicitly told it is?

Thanks for the link. I'll take a look at the DBPix evaluation and might be able figure something out.
0
 

Author Comment

by:AngusT
ID: 39837864
Judging by the links above, it seems to confirm my suspicions that Long Binary Data isn't going to be recognised by any of the standard controls in Access as an image.

However, DBPix works perfectly! Used as a bound control, similar to PictureBox, which displays the PhotoField as an image it worked without a hitch.

Now the real work begins to convince someone to pay the $350 for the license (Aussie & NZ office fighting over who's cost centre it is going under, but thats not a technical problem. :)

Thanks everyone.
0
 

Author Closing Comment

by:AngusT
ID: 39837868
It isn't a solution in itself if you aren't able to, or aren't willing to, pay for the DBPix control, but it does solve the problem of one of the shortcomings of Access.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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 the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

801 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