Add linked images automatically

  • Thread starter Thread starter colin.steadman
  • Start date Start date
C

colin.steadman

I have a folder containing thousands of small JPG image files (most
around 8k). I need to create a table in Access 2003 that contains a
link to each of these images as an OLE Object (I think). Within the
table I can click INSERT > OBJECT > CREATE FROM FILE and then type in
the path and filename of the image.

However its going to take forever to do it manually this way. Is there
any way to automate the whole process?

TIA,

Colin
 
I have a folder containing thousands of small JPG image files (most
around 8k). I need to create a table in Access 2003 that contains a
link to each of these images as an OLE Object (I think). Within the
table I can click INSERT > OBJECT > CREATE FROM FILE and then type in
the path and filename of the image.

However its going to take forever to do it manually this way. Is there
any way to automate the whole process?

Colin,

Do you have to duplicate the pictures into the DB? If not you could
store just the filenames and bring them into your program as they are
needed. To add a list of files to a table in your DB would be a simple
matter of parsing the output from the DIR command (this is available
inside Access). It is then a simple matter to display them in a
control, as you just pass the filename and Access will load in the
picture for you.

Chris.
 
Just to piggy back on Chris' post:

On my website (www.rogersaccesslibrary.com), are two small Access databases
sample called "Picture.mdb" and "PictureLoad.mdb" which you should look at.
Picture.mdb illustrates how to do display a picture that is stored in a
folder (rather than saved as an OLE object in the database).
PictureLoad.mdb shows how to use a browse dialog box to choose a file to
store in the database. It doesn't mass load them like you want, but could
be modified to do so. If it's just a one-time mass load, Chris' method
would work great. Or I've got a similar method in a sample called
"DirectoryList.mdb".

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Guys, You solved my problem :-)

Access now says it does not support .tif images... And I wold not want to
convert those to .jpg or bmp.

What should I do?
 
You might want to store the path to the pictures as a hyperlink. I also
have a sample called "SetHyperlink.mdb" which shows how to do that. When
the user clicks the hyperlink, it will open the file in the associated
program (assuming there IS an associated program on the computer they're
using.)

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Thanks Chris, and sorry for delay replying. There is no need to
duplicate the images in the database, I only need to store the link.
Could you describe how this DIR command works inside Access, as I've no
idea how to go about doing that.

Thanks again.

Colin
 

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

Back
Top