5

I made few forms in Access 2010 and I add logo of company to the header form. This picture is .jpg and size of it is 70KB. I don't know why size of .mdb immediately increased from 4MB to 12MB? (few forms and the same logo) Maybe there is some options of image compression ?

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
mathewM
  • 139
  • 1
  • 1
  • 14
  • 1
    Someone with knowledge of Access 2010 in particular should answer this, but in older versions of Access images were not stored in their compressed format and so adding a small JPG could drastically increase DB size. Have you tried compacting the DB to see if that made a difference? – pstrjds Jun 11 '12 at 15:21
  • Compacting doesn't change much. In my case there was 12,4 MB and now it is 11,9 MB. – mathewM Jun 11 '12 at 15:39
  • @pstrjds I am not exactly sure how this works, but mdb is the older format and, I suspect, subject to the bloat that was a problem for the older versions. I wonder would it be worth trying the accdb format? – Fionnuala Jun 11 '12 at 19:02
  • 1
    @Remou That sounds reasonable. I suppose it depends if it needs to be an `mdb` file or if a newer format would be acceptable. I don't normally work with Access anymore and I don't know what the tradeoffs between MDB and ACCDB are, but it does appear (from quick search and scan of returned documents) that you should get better binary data storage so I would suspect that it will handle the jpg natively as opposed to storing it as a bmp. – pstrjds Jun 11 '12 at 19:09
  • Indeed. It saves 2MB. So I've got 10MB. I was thinking about 2-3 MB for my application. It is strange how 70KB image can be stored by Access in duplicated size? – mathewM Jun 11 '12 at 19:35
  • How will the database be distributed? You can take an image on a form and change it to Linked instead of Embedded as long as the end users have access to the jpg file. – nicholas Jun 24 '12 at 17:53

2 Answers2

5

Taken from http://office.microsoft.com/en-us/access-help/store-images-in-a-database-HP005280225.aspx

..."However, embedding images can rapidly inflate the size of your database and cause it to run slowly. This is especially true if you store GIF and JPEG files, because OLE creates additional bitmap files that contain display information for each of your image files, and those additional files can be larger than your original images. In addition, this method only supports the Windows Bitmap (.bmp) and Device Independent Bitmap (.dib) graphic file formats. If you want to display other common types of image files, such as GIF and JPEG images, you have to install additional software."...

To explain how these bitmap files are stored, the link below offers more explanation than the microsoft site:

Taken from http://www.ammara.com/support/kb/showkbe5cc.html

..."OLE Linking & Embedding is a technique used by Microsoft Access to store 'Objects' in database tables.The technique relies on the associated external application to store, present and edit the data. In some cases an additional uncompressed 'preview' image is also saved in the table (even when linking). This preview image is used for faster display of the data, or when the server application isn't available. This can cause a massive overhead. If you're storing jpeg images the uncompressed preview can be ten or twenty times the actual image size, causing the size of the database to rocket."...

So, when you drop an image onto a form in MS Access, uncompressed image data is saved to the system tables. This is actual uncompressed table data, so a compact and repair may offer little help.

The common workaround seems to be store the path to the image in a database table, and use that path to invoke the image on the form.

EBarr
  • 11,826
  • 7
  • 63
  • 85
EastOfJupiter
  • 781
  • 5
  • 11
2

I don't know WHY (and I don't care) but I already noticed that behaviour as well. My workaround for company logos or equivalent is to insert it in ONE form, which I then insert as a subform wherever I need it. It has the added benefit that if the logo changes one day, there is only one place to update.

iDevlop
  • 24,841
  • 11
  • 90
  • 149