automate photo import, link, and name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have read the threads about getting images into the database as well as linking by OLE. HEre is my question. I have a dirctory with a few hundred photos of people who each have an ID number. They are each named as "##### lastname, firstname.jpg

I would like to enter each one as a record but I don't want to have to type each file's name. Is ther a way I could tell access to import each file?

Next I want to link each record to data for each person. I have a database where the ID number would be the key. How could I extract the ID number from the photo name and have it entered so I could link to the ID number in each record.

I am trying to not have to enter everything by han

thank
 
Hi,

Having read the threads you'll understand that it's best not to store
the pictures actually in the mdb file, but to leave them as separate
files and just store their names and locations.

You can get a list of them that you can import by opening a command
prompt (MS-DOS prompt) and using the CD command to navigate to the
folder. Then use a command like this
DIR *.jpg /B > piclist.txt
to create a textfile containing a list of the files.

Import this into a table in Access, specifying ; or | as the delimiter
character, so it imports into a single field. Add another field to this
table for the ID number (of the same data type as the ID field in your
existing table), and use an update query to extract the ID from the
filename and put it into the new ID field.

You'll need a calculated field in the query to do that, something like
this (where FileName is the name of the field with the filename)
ID: Left([FileName], InStr([FileName]," ") + 1
if ID is a text field, or this
ID: CLng(Left([FileName], InStr([FileName," ") + 1
if it's a numeric field.


I have read the threads about getting images into the database
as well as linking by OLE. HEre is my question. I have a dirctory with
a few hundred photos of people who each have an ID number. They are
each named as "##### lastname, firstname.jpg"
 
Back
Top