Displaying OLE Object images in an Access database form
Posted on 2014-02-04
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.