Images in Database (e.g., jpgs)

D

Deborah B

I am making an inventory of my art. I must be able to SEE a thumbnail of
each of the paintings as part of each record. Links and clicks will not work
for me. I have to be able to scroll down and see each image as I go. The
Database will have about 300 records, max. It is easy to insert a photo in
Excel and Word. What am I missing. Can't figure out how to get them into
my database. Help please
 
L

Larry Linson

Deborah B said:
I am making an inventory of my art. I must be able to SEE a thumbnail of
each of the paintings as part of each record. Links and clicks will not
work
for me. I have to be able to scroll down and see each image as I go. The
Database will have about 300 records, max. It is easy to insert a photo
in
Excel and Word. What am I missing. Can't figure out how to get them into
my database. Help please

What's with this "links and clicks won't work for me" stuff? You can have
external files without "links and clicks". And, if you insist on storing the
pictures internally, Access 2007, it is said, eliminates the long-standing
database-bloat problem.

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.

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.

And, Stephen has an ActiveX control available that works in cases where the
graphics filters are not available -- and works better, I've heard, than the
OLE Object and OLE Controls.

Please note that there are other approaches, e.g.,
Application.FollowHyperlink, but those, like OLE and Bound OLE Frames still
leave you "at the mercy of the imaging software registered for the
filetype".

Finally, Access 2007 has enhancements that, reputedly, eliminate the
database bloat long associated with OLE Objects and Bound OLE Frames. But,
it still leaves you relying on the software registered for the image type,
which may not be as "cooperative" as we'd like in creating our display. It
also has the capability of having a variable number of Attachments to a
Record, which may be helpful. Be sure you have at least the first Service
Pack (that's all there is right now) installed, or have the SP in hand and
ready to apply as soon as you install Access 2007.

Larry Linson
Microsoft Office Access MVP
 
T

Tom Wickerath

To add a little bit to Larry's comments, Access 2007 (if you are running this
newest version) allows you to avoid the file bloat associated with using OLE
Embedding technology *only* if you are using the newer .accdb file format.

Here is a sample image DB that I have available, as long as links (linked
files) are acceptable to you:

http://www.accessmvp.com/TWickerath/downloads/ImageDemo.zip


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
 
D

Deborah B

Larry Linson said:
What's with this "links and clicks won't work for me" stuff? You can have
external files without "links and clicks". And, if you insist on storing the
pictures internally, Access 2007, it is said, eliminates the long-standing
database-bloat problem.

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.

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.

And, Stephen has an ActiveX control available that works in cases where the
graphics filters are not available -- and works better, I've heard, than the
OLE Object and OLE Controls.

Please note that there are other approaches, e.g.,
Application.FollowHyperlink, but those, like OLE and Bound OLE Frames still
leave you "at the mercy of the imaging software registered for the
filetype".

Finally, Access 2007 has enhancements that, reputedly, eliminate the
database bloat long associated with OLE Objects and Bound OLE Frames. But,
it still leaves you relying on the software registered for the image type,
which may not be as "cooperative" as we'd like in creating our display. It
also has the capability of having a variable number of Attachments to a
Record, which may be helpful. Be sure you have at least the first Service
Pack (that's all there is right now) installed, or have the SP in hand and
ready to apply as soon as you install Access 2007.

Larry Linson
Microsoft Office Access MVP

Deborah B
Larry; thanks for the reply. I didn't understand that with the various methods dependent on inserting the address of the picture in my files resulted in the image actually being displayed (I thought you had to click on it to see it - sorry, seems dumb now). I got to the following point in your discussion (cut and paste)

Images as External Files

"It is simple to display images stored separately in disk files and doing so
eliminates the need for the automation server and the overhead of OLE, so it
is also a more responsive technique. All you have to do is to store the path
and file name into the Picture property of the Image control. Although the
Image Control is thrifty in its use of system resources, it has an adequate
capability for displaying images and reasonable flexibility. Only the path
and filename, including the file extension, need be stored in the database
record, along with any related information."

But I don't understand how to get the path information into my Access 2003
database. How do I find and use this "Image Control" you talk about?

I appreciate your responding to my post. If you are at all interested, you
might want to check out my website at www.dbertola.com . In the meantime I
have built a pretty OK inventory using Excel. It seemed so easy!
 
M

michael brooks

See my comments at the bottom

Deborah B said:
Images as External Files

"It is simple to display images stored separately in disk files and doing
so
eliminates the need for the automation server and the overhead of OLE, so
it
is also a more responsive technique. All you have to do is to store the
path
and file name into the Picture property of the Image control. Although the
Image Control is thrifty in its use of system resources, it has an
adequate
capability for displaying images and reasonable flexibility. Only the path
and filename, including the file extension, need be stored in the database
record, along with any related information."

But I don't understand how to get the path information into my Access 2003
database. How do I find and use this "Image Control" you talk about?

I appreciate your responding to my post. If you are at all interested, you
might want to check out my website at www.dbertola.com . In the meantime
I
have built a pretty OK inventory using Excel. It seemed so easy!

Note: I don't visit this forum very often, so may not be checking back and
may not be of much help beyond what is stated below. But you can search in
Help for anything that is not clear.
Here's how I managed to display images on a form.

Note that it is far more efficient if images are displayed at their natural
size, rather than sizing to fit.
1. In the toolbox, I selected the image control, and drew it on the form
2. In the properties for the image control I put picture type = linked, size
mode = clip, picture alignment = top left. You can probably press F1 to get
help on any of the property settings.
3. Displaying properties for the form, I clicked the event tab, then on the
on current event, and for the "on current" event clicked the "..." to take
me to the VB editor.
4. The code in the event procedure changes the image each time the user goes
to a new record. The path to the image could be a field in the database, but
in my case a field ("seq") gives a number which relates to the name of the
image.

Here's a simplified version of the procedure I used.
As stated, in my case, the database field called "seq" contains a number
which determines what image to load.
"Me" refers to the form; "Me.imgSutra" refers to the picture control, and
"Me.imgSutra.Picture" is the property giving the path to the image. Me.seq
is a text control on the form bound to the "seq" field in the database--this
tells me what image to load.
You may not need the Format statement, but in my case if the "seq" field for
a record was (say) 10, then the statement becomes
Me.imgSutra.Picture = "C:\somepath\0010.jpg"

Private Sub Form_Current()
Me.imgSutra.Picture = "C:\somepath\" & Format(Me.seq, "0000") + ".jpg"
End Sub
 
L

Larry Linson

Deborah B said:
But I don't understand how to get the path information
into my Access 2003 database.

You can copy-and-paste, or you can type it in... it is just text. If you
can display your image, you must either know or be able to search and find
the path-and-file.
How do I find and use this "Image Control" you talk about?

The Image Control is an Access built-in control. It's one of the icons in
the Toolbox that you see in Design View (in Access 2003, unless you have
changed the default, it's anchored to the left side of the design view
display of your Form.

Keep asking... we'll do what we can to help you get to your goal.

Larry Linson
Microsoft Office Access MVP
 

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