Adding a photo to a record

K

Ken G

I've tried to add some photos to an Access 2003 database using OLE linking to
the photo in a separate folder.
In Form View the database field only shows the file name (no path), not the
picture. These are the steps I've taken.
Click in the field and select Insert Object/Crearte from File/Browse
Select the file then click "Link" and make sure Display as Icon is not ticked.
The field is formatted as OLE.
Does the picture need to be EXACTLY the same size as the field in the
database?
 
F

Fred

Reinforcing what Arvin said, we learned the hard way that doing it with OLE
in 2000/2002/3003 is nothing but trouble.
 
A

Arvin Meyer MVP

Fred said:
Reinforcing what Arvin said, we learned the hard way that doing it with
OLE
in 2000/2002/3003 is nothing but trouble.

It's more resource intensive than trouble. On beefy machines there's little
to worry about, but on many machines the resources get used up quickly,
leaving the problems you've seen.
 
K

Ken G

Thanks Arvin. Obviously I'm not an Access expert, but this seems to create
a database of pictures in a folder.

I'm trying to include individual pictures in individual records in a database.
 
A

Arvin Meyer MVP

If you put all your pictures in a single folder on your (or a server's) hard
drive, you can display them. The table creation is for the purpose of
gathering your pictures and loading the paths into the database. You can
then use that table by linking it to your other data tables, or perform an
update query to add the file and path columns to your existing table.
 
J

John W. Vinson

Thanks Arvin. Obviously I'm not an Access expert, but this seems to create
a database of pictures in a folder.

I'm trying to include individual pictures in individual records in a database.

Think about it:

What the user needs is to be able to open a database, select a record, and see
a picture.

Arvin's solution does EXACTLY THAT.

It's a matter of technique. Be aware that Access (up until version 2007) does
let you store images in the table, but it does so *very inefficiently* - a 20K
jpg file is stored as a 20K jpg *AND ALSO* as a .bmp image that may be 200 or
300K. It doesn't take very many of these monstrous records to make your
database bloat beyond the 2GByte storage limit.
 
K

Ken G

Thanks again Arvin. It took me a while to get my head around this but I now
have it working in my database, with one problem remaining.

My database allows for up to four pictures for each record, and I adapted
the code from the picture2k file to do this. The problem is, and it was there
when I began with the code for just one picture, that if a picture is
included in record A, it also appears in record B even though there is
nothing in the path and file name fields for record B. In my case of multiple
photos, if Record A has say 3 photos, and record B has only 2, the third
photo from Record A is displayed in Record B as photo number 3.

Do you know how I can prevent this. The same thing happens when entering a
new record. It already has the pictures from the previous record on display.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top