Simple clear advice in plain English

Hands on: Access all images

A picture is worth a thousand words, but takes up considerably more storage space

Storing images in databases is getting more popular.

For example, I’m currently developing a database at Cambridge University which is storing digital images of Charles Darwin’s herbarium specimens.

We are using Access as the front end and SQL Server as the back end.

Ultimately these will be made available to anyone with a browser. And it’s not just academics, everyone is doing it.

People store ID pictures, images of products, the list is endless. So, what options do you have? There are several ways to store images in a database. I’ll illustrate them in Access but they are true (with variations) for a number of different engines.

Images in the database
Of course, just as text needs to be stored in a text field and dates in a date field, an image needs a special field type. In SQL Server it is called ‘Image’ but in other engines it can have other names including the glorious Blob (Binary Large Object) data type.

In Access images are stored in an OLE Object field. The pros and cons of this choice are very well summed up (for those who are interested in the detail) here.

One problem with saving images as OLE objects is that the Access database inflates faster than a fat cat’s salary. To quote from the article above: “However, this method 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 an additional bitmap file that contains display information for each of your image files.

“Those additional files can be larger than your original image and thus bloat your database. Keep in mind that Access databases have a 2GB size limit. If you have a large number of images, you can reach that limit quickly.”

In other words, adding a 1MB image may well expand the database by considerably more. So, beware the bloat but, on the other hand, this is a very handy way of storing a limited number of images. And, of course, if you move the database, the images come too; which isn’t true in the next option.

Pointing to images
For this you still use the OLE Object data type but you choose the ‘link’ option when selecting the image (see the practical steps that follow). The image is not copied into the database; all that is inserted into the database is a link to the image.

This, again, has pros and cons. On the pro side, the database bloat is much reduced for obvious reasons. If you edit one of the image files that are stored on the disk, that change is visible if you look at the image from within the database; since the two are one and the same. This ‘feature’ can be either a pro or a con, depending on the functionality that you want.

However, if you move the Access file to another computer, the images don’t travel with it. It can also be difficult to update the link between the two since the pointer to the image (for example, C:\MyPics\Hols\ BrianBeingSilly.JPG), which must be stored somewhere in Access, is not readily available for editing.

Article tags

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Hands on: Solving a storage and usabililty problem

How one-to-one relationships can help optimise storage without causing problems for users

Feature: Top 50 Microsoft Office tips

Get the best out of Word, Outlook, Excel and PowerPoint with our selection of Microsoft Office tips

Feature: Set up the ultimate home network

A properly configured home network can offer you a lot more than you might have imagined

Question & Answer

Q.How do I store musician and other information about...

> Read the answer

Q.Why can't my browser find the website address I typed...

> Read the answer

Q.All updates have been downloaded, so why won't Windows...

> Read the answer

Best deals on the web

img

THREE E585 Mi-Fi Take it Away Mobile Broadband - 5GB allowance

£44.97- Buy it now

img

T-MOBILE 3G Pay As You Go iPad Micro SIM

£0.10- Buy it now

img

THREE Huawei E353u Take It Away Mobile Broadband - One Month Rolling Contract

£4.99- Buy it now

Great benefits for subscribers!

Poll

Which is your preferred web browser

Jargon Buster

Computing terms explained in plain English

CAD

Computer Aided Design. Software used to create 3D models.

Great shopping deals from Computeractive