Link to home
Start Free TrialLog in
Avatar of AngusT
AngusT

asked on

Displaying OLE Object images in an Access database form

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.
Avatar of gplana
gplana
Flag of Spain image

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.
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
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
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AngusT
AngusT

ASKER

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.
Avatar of AngusT

ASKER

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.
Avatar of AngusT

ASKER

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.