help with storing image files in access database and displaying imagefiles in reports (access 2000)

P

pheonix1t

hello,
I have to link to a large amount of images (jpb, gif and bmp). I
created a table and set the data type of the field with the image file
names as OLE Object. Then, I have to go to each record of the pictures
column and create a link to the image file it corresponds to. (is there
a faster way to do this? I do know all image files aren't in the same
directory).

So, after doing this, jpg and gif files work fine. But now, bmp files
don't display on the reports. I keep getting a 'Package' output on the
record where I linked to the bmp image file. The output on the
'pictures' column from jpg or gif files is 'Editor 3.0 Photo'. Jpg and
gif files work fine, when you run the reports you can see these types of
pictures.

I'm surprised that Access is causing trouble with bmp image files. Then
again, I don't know too much about how to make access play well with
image files.

HELP!



Thanks,

Oskar
 
S

Stephen Lebans

I'm sure you are aware that even Linking a file results in the infamous OLE
bloating...huge increase in MDB size for each image inserted. Linking still
results in a Presentation stream being embedded within the object. This
Presentation stream contains an uncompressed Bitmap(usually wrapped within a
MetafilePict object.

With that being said, instructions below to setup MS Photo Editor as the
registered application on your system to display Bitmap files and enable the
app to act as the OLE Server for BMP files.

The only reasons to use an OLE object field to store Images 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/Print 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.Picture = Me.NameOfTextBoxBoundToFileNameField


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
([email protected])
Subject: Re: Inserting picture into an access form


View this article only
Newsgroups: microsoft.public.access.activexcontrol
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.
 

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