Display image

  • Thread starter Thread starter B. Lendman
  • Start date Start date
B

B. Lendman

I've got images stored in a sql table that I'm trying to
display on Access forms and reports... but doesn't work.
We're able to handle these images in ASP from sql to
display them on a webpage but can't get them to display
in access. Any guidance would be most appreciated.
 
BL> I've got images stored in a sql table that I'm
BL> trying to display on Access forms and reports...
BL> but doesn't work. We're able to handle these
BL> images in ASP from sql to display them on a
BL> webpage but can't get them to display in access.
BL> Any guidance would be most appreciated.

Use the example from MSKB Q175261 ; then cut off first 8 bytes from the
result returned by the function from the article.


Vadim
 
Access can only displays images which are stored with an OLE Header.
This header give Access the possibility of displaying any OLE linked or
stored objects and not only gif or jpeg images, for example a Word document
as well, but become a real pain in the back when you have to display theses
images on a web server or in another image manipulation tool. In one way,
the header is missing and Access can display it; in the other way, the
header is there and Access can display it but your other application can't.

There are two solutions. The first one is to store the images under the
Access format and strip the header when you have to use them in another
application. See the other answer for a reference. You can also use a
constant length for stripping the header if you always store the same kind
of images.

The second solution is to use an OCX or an Active-X control for
storing/displaying bare images (without OLE header) inside Access. See for
exemple http://www.chestysoft.com/ximage/access1.asp but you can find many
others on the web.

By the way, since Access 1.0, this problem is probably the one that
comes out most often. Curious that Microsoft never accepted to give it a
simple solution, like adding a linked control image or a function to add or
strip the ole-header. Somewhere, someone must be really stubborn.

S. L.
 
You can extract the image to a temporary file then load it into an image control (assuming that the relevant
Office Graphics Filters are installed, and subject to the image control limitations - eg progress dialog,
scroll-too-quick crash etc).

Alternatively, as mentioned, there are several 3rd party controls designed to work with raw image data.
Among them is our own, DBPix, which is designed to work in Access Forms & Reports (as well as in VB, IE
etc), and it can be bound directly to the relevant field (depending on the actual image format). For more
info and downloads see the sig below.
 
Back
Top