| | |
|
|
|
OLE with image files and the resulting .MDB file size |
| message from =?Utf-8?B?TWF0dCBDLg==?= on 11 May 2004 |
I am using Access 2000 to create databases which include images. My understanging of OLE is a bit hazy - most of the books I've seen make the claim that using an embedded OLE object will insert the entire file contents of the embedded file into the database, while linking the file is supposed to store a pointer to the file without copying the contents of the file into the database. However, I've been putting together a database that uses a large quantity of image files, and the size of the database suggests that OLE doesn't work that way at all. I had tried to save space by compressing the files as JPEGs or GIFs (depending on the content - photos or line art), then linked the images in, and this seems to have backfired. The database expanded until its size on the disc easily exceeded the size of all the images stored in it by well over an order of magnitude.
So, to see how much room the files take up, I created four databases to test the effects of using BMP files vs JPEG files, and linking versus embedding. Each one used a table storing six images combined with a simple form to input images. The images were identical, generated by running the source JPEGs through a converter to make BMP files. The total size of the JPEG files came to 585 kB. Linking them into a database resulted in a 16.6 mB MDB file, while embedding them caused the file to expand to 24.8 mB. With BMP files, the original files totalled 4.68 mB in size. Linking them into a database created a 9.62 mB file, while embedding them surprisingly caused the file to shrink to 4.83 mB.
Had linking actually stored only the file name in the database, I would have expected the databases using linked OLE objects to only be a few kilobytes in size. The only file size that fits what I have heard about OLE is the embedded BMP's, which results in a file large enough to contain the source pictures plus whatever other data Access stores in the file. I get the impression that linking has caused Access to store its own copy of the file in a less space efficient format. Is there any way I can make Access store only the location of the image file when the picture is not being viewed or printed? The main database has grown so large I'm worried the shear size of the pictures stored in it is slowing the whole thing down.
|
| Stephen Lebans replied to =?Utf-8?B?TWF0dCBDLg==?= on 11 May 2004 |
Even with Linked OLE objects, an uncompressed Bitmap(DIB) of the Image
is stored in the OLE object field. There is no way around this. I have
explained the OLE object embedding process, as it pertains to Images, in
detail in several posts over the years.
If you are using linked Images, the only reason to do so would be to
enable the user to either:
1) Double click the Ole Frame control to allow the user to edit the
Image.
or
2) Show the Images within a form set to Continuous view.
If neither of these reasons are critical to your app then do not link or
embedd, simply store the Image name in your table.
|
| =?Utf-8?B?Q29ycmluYSBCdXJubGV5?= replied to Stephen Lebans on 11 May 2004 |
For quick access to the image, store a hyperlink to the image file in the table.
Corrina Burnley
Burnley Data Solutions
www.burnleydatasolutions.com
|
| =?Utf-8?B?TWF0dCBDLg==?= replied to Stephen Lebans on 12 May 2004 |
Thank you. This database does need to print the pictures on reports, and being relatively new to using Access, I'm not really sure how I could get it to print the images if I'm just storing the file path in a text field (although I wouldn't be surprised if there is a way). I guess my best option for the time being would be to convert them to BMPs and embed them. Looks like the explanation of how object linking works given in the Access 2000 Bible (which was what I'd been going by when I put the database together) is just plain wrong, at least as it pertains to images.
|
|
Archived message: OLE with image files and the resulting .MDB file size (Microsoft Access)