Access 2003 will not display .BMP/.DIB files in OLE field

G

Guest

Documentation claims that bitmap image files in OLE fields are displayed by
default, and that other image file types require workarounds.
However, my access database is not displaying bitmap images.
I have tried installing Photo Editor but I still get the "Package" result
instead of the actual image.
Is there some setting I've missed which will allow Access to display the
file I have embedded in the OLE field without having to open the "Package"?
 
S

Stephen Lebans

Access can use the default Handler contained in the OLE2.DLL to display
Bitmap and Metafile Images as long as they are packaged correctly.

Installing Photo Editor and having it "registered" to handle Bitmap
Images would only work for Images you insert AFTER PHoto Ed is
installed.

For Bitmap images, MS Paint can be used as the OLE Server app.

Here is a previous post of mine on this subject.

Newsgroups: microsoft.public.access.forms
From: "Stephen Lebans"
<ForEmailGotoMy.WebSite.-WWWdo­tlebans­[email protected]> - Find
messages by this author
Date: Mon, 29 Nov 2004 20:52:36 -0400
Local: Mon,Nov 29 2004 7:52 pm
Subject: Re: .jpg pictures are allowed to store as OLE objects?
Reply to Author | Forward | Print | Individual Message | Show original |
Report Abuse


The format of the image file is completely independant of Access. It is
the responsibility of whatever Image/Paint program is currently
registered with WIndows to view the Image file types and act as the OLE
server for the object inserted into the OLE object field.
MS Photo Editor is generally used as the OLE server for Access. It must
be setup and registered to handle the selected image file types.


Before I explain how to setup Photo Editor to be registeredd for the
relevant Image file types one note of caution. Images embedded as OLE
objects will quickly fill up your MDB. A small 40KB JPG can end up
consuming several MB's in storage space. If you are planning on storing
a large number of images or even a few extremely high resolution images
then you should not be using OLE.


Why do Images embedded as OLE objects take up so much storage space?


In a nutshell:
An Image inserted as an OLE object is no longer the same size as the
original file. It is converted to a DIB(uncompressed Bitmap) and then
wrapped in a EMF(Enhanced Metafile). THe EMF is then wrapped within the
OLE stream. Further, if the original Image was not a Bitmap or Metafile,
then another full size DIB preview is inserted into the OLE stream.


THe only reasons to use an OLE object field are if you require:


1) The ability for your users to Edit the Image in the Program that acts
as the OLE server.
2) The ability to view the Images with a Form in Continuous View.
3) The Images are embedded for security concerns.


In reality, the enormous OLE file size "bloating" stops most users from
inserting more than a few images. With the exception of viewing the
images with a Form in Continuous view, coding solutions for the other 2
issues are available.


The most common solution is to simply keep the images in a seperate
folder storing the filenames only in a Text field. Using the Current
event of the Form or the Format event of the relevant section on a
Report, place a line of code to load the picture into the standard Image
control NOT the OLE Frame control.


Me.NameOfPictureControl.Pictur­­e =
Me.NameOfTextBoxBoundToFileNam­­eField


There is lots of sample code out there complete with error checking.
Search GoogleGroups.


******************************­­***************
Here is a previous post of mine on for how to setup MS Photo Editor:
Message 4 in thread
From: Stephen Lebans
(ForEmailGotoMy.WebSite.-WWWdo­­[email protected])
Subject: Re: Inserting picture into an access form


View this article only
Newsgroups: microsoft.public.access.active­­xcontrol
Date: 2004-11-12 19:43:08 PST


In this case the OLE server is simply an Image/paint program that:
1) Can function as an OLE Image server
2) Is registered to handle the specific Image file types you want to
insert into the OLE obect field.


In most cases, MS Photo Editor is used as the OLE Server program. It
must though, be setup as the default/registered handler for the image
file types in question. MS Photo Editor is no longer included with
Office 2003. YOu will have to find you Office XP or WIn2K disks and
install MS Photo Editor only!


The simplest method to associate a program with a specific file
extension(BMP,JPG,etc.) is to:
1) Open a folder containing the Images you want to insert.
2) Right click on a file while holding down the SHift key.
3) From the popup menu select "Open With".
4) Scroll down the Open With Dialog window until you find MS Photo
Editor and select it.
5) Check the Always use this program to open this file type CheckBox
control.
6) Click OK.


Repeat the steps once for each different type of Image file you want to
embedd in your table.
******************************­­***************



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Liam Judd said:
Documentation claims that bitmap image files in OLE fields are displayed by
default, and that other image file types require workarounds.
However, my access database is not displaying bitmap images.
I have tried installing Photo Editor but I still get the "Package" result
instead of the actual image.
Is there some setting I've missed which will allow Access to display the
file I have embedded in the OLE field without having to open the
"Package"?
 
G

Guest

Thank you, Stephen.

I had read your previous post and was mystified by the behavior I
encountered on my system. Even after the installation of Photo Editor, and
after the assignment of that program to open .bmp files (and a reboot), and
confirming that Photo Editor is launched when opening a bitmap file, I got
the same results as before even with newly inserted images: Access displays
the file icon and name in the OLE field instead of the image.

I did discover a workaround:
1. Open and copy the image in Photo Editor
2. Right-click on the Access OLE field
3. Select Insert object
4. Create new
5. Bitmap Image
6. Paste the image

The image appears in the form as expected.
 
G

Guest

Thank you, Liam. I have been experiencing the same problem - I'm using a
bitmap image in an OLE field in Access 2003 (without Photo Editor) and still
see "Package" instead of "Bitmap Image". However, your workaround works
great. When I choose Create New... Bitmap Image and click OK, Paint opens. I
then choose Edit / Paste From... and can navigate to the image I need.

I'd rather not store the images in the database, but I still can't get the
link option to work properly with bitmaps in an OLE field. I will try
Stephan's suggestion of storing just the text path, using that with an image
control.
 
S

Stephen Lebans

Do you have Norton Antivirus running by chance? If so try turning it off
temporarily and see if that corrects your issue.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

No. I have Symantec AntiVirus and can disable Auto-Protect, but that doesn't
make any difference in Access.
 

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