Solved

Displaying OLE Object images in an Access database form

Posted on 2014-02-04
7
8,930 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 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

Independent Software Vendors: 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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

729 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