View Full Version : Report with background image pops up the db size?


mvo
05-13-2009, 04:56 AM
Hello Access heroes,

I am encountering a very strange problem. Let me explain the situation.

I was asked to make an Access database that holds all the hardware currently owned by the company. Consultants can receive hardware from the company so that needs to be tracked in the database as well.

Whenever a consultant receives for example a laptop or a cell phone, he has to sign a form stating that he received the hardware at the current date etc. I was asked to implement this automatic generation of that form in Access.
I managed to pull that off with the help of a Report, getting all the necessary data from other forms. I've scanned the paper form and put the scan in the report in Access. I then positioned all the text boxes accordingly.
After all was done, the database was ~3MB.

Now I have to do the same for the database with all the company cars and their drivers. This procedure of giving a company car requires 2 different forms which I also scanned in. Those scanned images are ~2MB.
I followed the exact same workmethod as I described above to create an automatically generated form, but after I'm done (and after compacting the db) the database measures 117MB!

Some stats:
Scanned image from the hardware db: 215KB, 1240x1754 pixels.
Scanned images from the car db: 1,63MB, 4477x6389 pixels.

The logic in my head says: db size (before the image was included) + image size = new db size.
How can it get from 2MB to 117MB (with 2 new reports with each having an image of 2MB)?

Can anyone think of some reason behind this and how I can solve this?

Thanks in advance,
-mvo

Edit: I forgot to mention that I can't share the databases with you, as they include sensitive data. I can however provide you with my settings or anything else you need.

Edit2: My title might be misleading. The "background" images are not issued as a real background (Report Properties), since that complicates the positioning of the text boxes etc. They are inserted as a regular image and then properly sized and positioned "send to back".

HiTechCoach
05-13-2009, 05:25 AM
Embedding images in a Access database cause extreme database bloating and is normally avoided.


The logic in my head says: db size (before the image was included) + image size = new db size.
How can it get from 2MB to 117MB (with 2 new reports with each having an image of 2MB)?

It does not work like that. It also have to include all the OLE information.

I normally just recreate the paper form as an Access report using text boxes, labels, lines, etc.


If you must use a image, then I would recommend that you not store the image in the database.



Edit: I forgot to mention that I can't share the databases with you, as they include sensitive data. I can however provide you with my settings or anything else you need.

Is you database split? It really should be. Then you can have a back end of just text data that does not have any sensitive data.

HiTechCoach
05-13-2009, 05:30 AM
Also see:

Efficient Image Storage in MS Access - Store Photos, Graphics & Pictures in Access (http://www.ammara.com/articles/imagesaccess.html)

mvo
05-13-2009, 05:49 AM
Thanks HiTechCoach for the fast reply!


If you must use a image, then I would recommend that you not store the image in the database.


I am investigating on how I should link it, instead of embedding it. I didn't use Access before I started these projects.
By the way: why does my first db (hardware) doesn't get that much overhead as the car db? It seems to work perfectly at that one...

Edit: Do I have to create an extra table with the image path? This seems so over the top for just 1 image.. Is there a way to just link to a picture in the same directory, without an extra table for image paths?

Thanks

mvo
05-13-2009, 06:11 AM
Ok I've found a (temporary) solution. I've set the Image Type to "Linked" and Image to "C:\path\to\image.jpg". Database file size decreased to 1MB.
Only small downside is that the report loads a bit slower.

Thanks again.

wiklendt
05-14-2009, 06:53 AM
why not put a little more effort into the reports and delete the 'background' image?

mvo
05-14-2009, 06:55 AM
Because the official form is highly detailed. I would lose way too much time on reconstructing it in a report.