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

Using code
Instead of using an OLE Object field, you can use a text field. In that you store, not the image, but the text version of the path to the image (as mentioned on page one).

You can then use VB code to control the recall of the image and the way in which it is displayed. This is very economical because, no matter how large the image, all you store is a text string.

In addition, if you move the files to another computer, even if you store the images in a different folder, all you have to run is an update query on the text field to update the pointers to the new location. The bad news (depending on your current level of expertise) is that you need to use code.

Buy extra functionality
You can buy a specialised add-on for the database which provides additional functionality for images.
One such is DBPix from Ammara. I have to admit that I haven’t tried it myself but it seems to be highly recommended and you can download a fully functional evaluation version free.

I have to say that, overall, I am not entirely impressed with Access’ ability with images. For example the support for .JPG files is poor. Even though it will store them, you cannot display them in a form; at least, not by default.

Having said that, the process of storing and retrieving them is easy, so let’s take a look at this in practice.

Getting practical
Create a table and add a field with the OLE Object data type (all of this is done for you in DBCJAN08.MDB). If you’ve bought the DVD edition of PCW, you’ll find this database on the cover disc. It is also on the web at www.pcw.co.uk/2151344. You’ll notice that there are few properties that you can set for the field).

Then, using the autoform button, create a default form based on the table. Rather oddly, you have more control over the properties of the image here than you do in the table.

If you right-click on the control you’ll find you can set properties such as OLE Type Allowed. Now right-click on the image control, select ‘Insert Object’ and choose the ‘Create from File’ radio button. From here you can select whether to embed the image or link to it. You can also navigate to the image file of your choice.

No matter whether you embed or link them, JPEG files do not appear in the control. However if you double click on the control an application opens up which contains the image. BMP files, on the other hand are kind enough to appear in the box.

This method of adding images files is a little tedious but you can also drag and drop image files onto the control, which is much, much faster.

So, I may carp about the support for JPEGs but, as you can see, working with images has been made pretty easy in Access.

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: Getting attached to Access 2007

Take a look at some of the features and the new user interface for this Office package

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.Why are some of the keys on my keyboard doing strange...

> Read the answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Best deals on the web

img

Samsung RV520-A07

£359.98- Buy it now

img

Acer Aspire 5750G (LX.RXP02.019)

£399.99- Buy it now

img

Apple MacBook Pro (MD313B/A)

£904.37- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

Restore point

A Windows backup of system files and settings.

Great shopping deals from Computeractive