Tuesday, June 9, 2009

Graphics and Pictures in Access 2007

We sometimes discuss how it’s not a great idea to store BLOBs / digital pictures / graphics within the Access database file itself. The only advantage is that you keep all the (hopefully small) graphic files in one database file and it’s easy to transport the whole thing. The big disadvantage is that Access does not do anything or use anything with those graphic objects – the database engine does not index, search within or recognise faces (for example) within the digital pictures. In previous versions of Access, the situation was even worse, Access would manufacture several bitmap formats as per the OLE specification so a small JPEG picture would bloat up considerably once it was stored as an OLE picture. There are third party solutions but they expect you to licence and install .dlls on the participating machines. Here is an article describing the problems you may face and a comparison of the different techniques.

The redoubtable Larry Linson, and Stephen Lebans have various examples. See Stephen’s Picturebox , LoadJPEGGif webpages. Tony Toews’s famous website seems has an Image Handling webpage with resource links.

Northwind 2000 has an example with the Employees Form. Get it and take it apart.

Access 2007 has a new field type, the Attachment field type, which avoids this bloating, but you still fatten the Access database file with an “dead” matter.  Here’s an Office knowledgebase article "Attach files and graphics to records in your database

No comments: