images in Access tables

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

Guest

Hello! I have a table with 2000 records and each record represents a field
sample. I also have 2000 photographic images, one for each of the field
samples. My question is can I automatically import all the images to the
table (each to the corresponding field sample) or do I have to do it manually
2000 times?
Thanks,
Francisco
 
Hi Francisco,

If you are intending to store the image itself (rather than just the
path.filename of the image), then you should (read "MUST") reconsider.
Images stored in an Access database lead to "bloat" (except for Access
2007 - see below); in a recent test, a single 150kb jpg file increased the
size of an mdb file by aboout 4MB. With about 2000 photo images, I expect
that you'd actually exceed the maximum 2GB filesize allowed by Access!

Here's a quote from a commonly-posted reply by MVP Larry Linson to this type
of question:
<quote>
The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat, and
some other problems, associated with images in OLE Objects. (Note: Access
2007 has eliminated the bloat problem, but you still are using external
software and are subject to its featuree, funcions, and foibles.)

If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
<end quote>

HTH,

Rob
 
Hi Rob! I am really interested in store the path.filename of the image and I
want to know if I can do it automatically for the 2000 images, instead of
doing it manually 2000 times?

Thanks,

Francisco
 
Hi Francisco,

Whether you can do it automatically or not depends upon how your image
path/filenames are related to the records in your database.

If you have a set of image files with names that match (or even partially
match, but with a consistent matching pattern) an entry in a field (or
multiple fields) in a table in your database, and they are all in one
folder, then you can easily construct an update query to insert the
path/filenames into a field in the table.

For example: if your images are named "object_1.jpg" for an object named
"object_1", which has an entry in a field "ObjectName" in a table named
"tblThings", and all the images are .jpg files stored in the folder
"C:\Images\", then the following query would set the entry in the
ObjectImage field in the table:

UPDATE tblThings SET ObjectImage = "C:\Images\" & [ObjectName] & ".jpg";

If your image filenames are more complicatedly related to a field (or
fields) in your table, the expression in the SET clause of the update query
will need to be modified appropriately. This may be relatively easy to
construct, or it may be rather tricky. And, if your image filenames bear no
relation to a field (or fields) in you database, then you'll have to do it
manually (and I suspect that won't be your problem, since you posted a
question that assumes that it's do-able).

HTH,

Rob
 
Thanks Rob! I have now a field with the links to the images but the images do
not open when I click the links... What am I doing wrong?
Francisco

Rob Parker said:
Hi Francisco,

Whether you can do it automatically or not depends upon how your image
path/filenames are related to the records in your database.

If you have a set of image files with names that match (or even partially
match, but with a consistent matching pattern) an entry in a field (or
multiple fields) in a table in your database, and they are all in one
folder, then you can easily construct an update query to insert the
path/filenames into a field in the table.

For example: if your images are named "object_1.jpg" for an object named
"object_1", which has an entry in a field "ObjectName" in a table named
"tblThings", and all the images are .jpg files stored in the folder
"C:\Images\", then the following query would set the entry in the
ObjectImage field in the table:

UPDATE tblThings SET ObjectImage = "C:\Images\" & [ObjectName] & ".jpg";

If your image filenames are more complicatedly related to a field (or
fields) in your table, the expression in the SET clause of the update query
will need to be modified appropriately. This may be relatively easy to
construct, or it may be rather tricky. And, if your image filenames bear no
relation to a field (or fields) in you database, then you'll have to do it
manually (and I suspect that won't be your problem, since you posted a
question that assumes that it's do-able).

HTH,

Rob


xicogoes said:
Hi Rob! I am really interested in store the path.filename of the image and
I
want to know if I can do it automatically for the 2000 images, instead of
doing it manually 2000 times?

Thanks,

Francisco
 
Hi Francisco,

I've given detailed instructions on how to display images associated with a
particular record a couple of times recently in this newsgroup. Search this
group for a thread with the subject line "Importing Photos" and follow it
through; it should get you on the right track. As I said in my most recent
response to that thread a few minutes ago, I'm currently travelling, and
have limited access to the net, so that will have to suffice for the
present. I'll be able to help in more detail come next weekend.

Rob

xicogoes said:
Thanks Rob! I have now a field with the links to the images but the images
do
not open when I click the links... What am I doing wrong?
Francisco

Rob Parker said:
Hi Francisco,

Whether you can do it automatically or not depends upon how your image
path/filenames are related to the records in your database.

If you have a set of image files with names that match (or even partially
match, but with a consistent matching pattern) an entry in a field (or
multiple fields) in a table in your database, and they are all in one
folder, then you can easily construct an update query to insert the
path/filenames into a field in the table.

For example: if your images are named "object_1.jpg" for an object named
"object_1", which has an entry in a field "ObjectName" in a table named
"tblThings", and all the images are .jpg files stored in the folder
"C:\Images\", then the following query would set the entry in the
ObjectImage field in the table:

UPDATE tblThings SET ObjectImage = "C:\Images\" & [ObjectName] &
".jpg";

If your image filenames are more complicatedly related to a field (or
fields) in your table, the expression in the SET clause of the update
query
will need to be modified appropriately. This may be relatively easy to
construct, or it may be rather tricky. And, if your image filenames bear
no
relation to a field (or fields) in you database, then you'll have to do
it
manually (and I suspect that won't be your problem, since you posted a
question that assumes that it's do-able).

HTH,

Rob


xicogoes said:
Hi Rob! I am really interested in store the path.filename of the image
and
I
want to know if I can do it automatically for the 2000 images, instead
of
doing it manually 2000 times?

Thanks,

Francisco

:

Hi Francisco,

If you are intending to store the image itself (rather than just the
path.filename of the image), then you should (read "MUST") reconsider.
Images stored in an Access database lead to "bloat" (except for Access
2007 - see below); in a recent test, a single 150kb jpg file
increased
the
size of an mdb file by aboout 4MB. With about 2000 photo images, I
expect
that you'd actually exceed the maximum 2GB filesize allowed by Access!

Here's a quote from a commonly-posted reply by MVP Larry Linson to
this
type
of question:
<quote>
The sample imaging databases at http://accdevel.tripod.com illustrate
three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat,
and
some other problems, associated with images in OLE Objects. (Note:
Access
2007 has eliminated the bloat problem, but you still are using
external
software and are subject to its featuree, funcions, and foibles.)

If you are printing the images in reports, to avoid memory leakage,
you
should also see MVP Stephen Lebans'
http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails
during
the Access formatting process prior to being spooled to the Printer
Driver.
This MDB also contains code showing how to convert the contents of the
Image
control to a Bitmap file prior to printing. This helps alleviate the
"Out
of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
<end quote>

HTH,

Rob

Hello! I have a table with 2000 records and each record represents a
field
sample. I also have 2000 photographic images, one for each of the
field
samples. My question is can I automatically import all the images to
the
table (each to the corresponding field sample) or do I have to do it
manually
2000 times?
Thanks,
Francisco
 
Hi Rob! Thanks for your help!!! It is all working perfectly!

Francisco

Rob Parker said:
Hi Francisco,

I've given detailed instructions on how to display images associated with a
particular record a couple of times recently in this newsgroup. Search this
group for a thread with the subject line "Importing Photos" and follow it
through; it should get you on the right track. As I said in my most recent
response to that thread a few minutes ago, I'm currently travelling, and
have limited access to the net, so that will have to suffice for the
present. I'll be able to help in more detail come next weekend.

Rob

xicogoes said:
Thanks Rob! I have now a field with the links to the images but the images
do
not open when I click the links... What am I doing wrong?
Francisco

Rob Parker said:
Hi Francisco,

Whether you can do it automatically or not depends upon how your image
path/filenames are related to the records in your database.

If you have a set of image files with names that match (or even partially
match, but with a consistent matching pattern) an entry in a field (or
multiple fields) in a table in your database, and they are all in one
folder, then you can easily construct an update query to insert the
path/filenames into a field in the table.

For example: if your images are named "object_1.jpg" for an object named
"object_1", which has an entry in a field "ObjectName" in a table named
"tblThings", and all the images are .jpg files stored in the folder
"C:\Images\", then the following query would set the entry in the
ObjectImage field in the table:

UPDATE tblThings SET ObjectImage = "C:\Images\" & [ObjectName] &
".jpg";

If your image filenames are more complicatedly related to a field (or
fields) in your table, the expression in the SET clause of the update
query
will need to be modified appropriately. This may be relatively easy to
construct, or it may be rather tricky. And, if your image filenames bear
no
relation to a field (or fields) in you database, then you'll have to do
it
manually (and I suspect that won't be your problem, since you posted a
question that assumes that it's do-able).

HTH,

Rob


Hi Rob! I am really interested in store the path.filename of the image
and
I
want to know if I can do it automatically for the 2000 images, instead
of
doing it manually 2000 times?

Thanks,

Francisco

:

Hi Francisco,

If you are intending to store the image itself (rather than just the
path.filename of the image), then you should (read "MUST") reconsider.
Images stored in an Access database lead to "bloat" (except for Access
2007 - see below); in a recent test, a single 150kb jpg file
increased
the
size of an mdb file by aboout 4MB. With about 2000 photo images, I
expect
that you'd actually exceed the maximum 2GB filesize allowed by Access!

Here's a quote from a commonly-posted reply by MVP Larry Linson to
this
type
of question:
<quote>
The sample imaging databases at http://accdevel.tripod.com illustrate
three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat,
and
some other problems, associated with images in OLE Objects. (Note:
Access
2007 has eliminated the bloat problem, but you still are using
external
software and are subject to its featuree, funcions, and foibles.)

If you are printing the images in reports, to avoid memory leakage,
you
should also see MVP Stephen Lebans'
http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails
during
the Access formatting process prior to being spooled to the Printer
Driver.
This MDB also contains code showing how to convert the contents of the
Image
control to a Bitmap file prior to printing. This helps alleviate the
"Out
of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
<end quote>

HTH,

Rob

Hello! I have a table with 2000 records and each record represents a
field
sample. I also have 2000 photographic images, one for each of the
field
samples. My question is can I automatically import all the images to
the
table (each to the corresponding field sample) or do I have to do it
manually
2000 times?
Thanks,
Francisco
 
Back
Top