Having problems inserting a photo into a table

  • My dad has MS Access 2007 on his PC. I've got it on one of my desktops. He called me up, asking how to insert an image into a field of an Access table. Frankly, I've never done that, but whipped up a simple table, with an indentify (autonumber) field and an OLE Object field, and tried to insert images. I found that if I choose .jpg files, they got inserted into the field with a label of "Package", but if I inserted a .bmp file it got inserted into the field as a "Bitmap Image". More importantly, when I generated a quick report against that table, all of the "Package" items appear as broken images, but all of the "Bitmap Image" records had images in the report. So, clearly it looks to me as though they have to be .bmp files. I told my dad that, and he went and tried to do that. However, he claims that all of them get inserted as "Package", so none of them look right in reports.

    Why? What's he doing wrong? Is there some configuration setting he needs to take care of?

    Rod

  • This turns out to be a complicated subject. The first question is whether he is using the old .mdb format for his database, or whether he is using the new .accdb format? In the .mdb format, storing photoin an Access table is problematic if you have more than a few to store, as the database will grow by a significant amount for each photo. Access actually stores both the original .jpg as well as a .bmp format image. The usual solution to that is to store a link that gives the path and file name of the image and to dynamically load that information into an image control on a form when you want to view it.

    If he is using the new .accdb format, it still supports the old approach, but adds a new kind of field type called Attachment. This Microsoft Support Article goes into a fair bit of depth on how to use that type. However you should be aware that there have been some issues with that field type in early versions of 2007, so make sure your Dad has SP2 installed.

    Wendell
    Colorful Colorado
    You can't see the view if you don't climb the mountain!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply