Displaying images

  • Thread starter Thread starter Ed Swartz
  • Start date Start date
E

Ed Swartz

I'm working on a web application written in ASP, using SQL Server, and
Access for the administrative backend.

The client wants to store JPEG photos in the database. I've added an
image field to the appropriate tables and created an Access form with VB
script that imports the photos from files into the database.

Now I need to display the photos on the appropriate Access forms.

I uploaded a test photo into a test record. Then I created a Bound
Object Frame and set the Control Source to the image filed (named Photo,
what else...).

When I open the Access form on the test record nothing displays in the
Bound Object Frame. I'm certain that I have a JPEG image stored in the
test record because I can pull out the image and display it with ASP on
a browser.

Any debugging ideas ?


Ed Swartz
 
The bound object frame uses OLE-Embedding/OLE-Linking to store and display images or other data; it will
not work with raw-binary image data.

You can do this with the Access image control - you'll need to extract the image data from the field to
a temporary file then load that into the image control. You'll find workarounds to some issues with the
image control at 'The Access Web' here:
http://www.mvps.org/access/toc.htm

Another approach would be to use a 3rd party control such as our own. With this you can just bind it to
the field as you already tried with the Object Frame. For more info see the url below.
 
Ed,

Storing the image in the database causes the database to become huge.

It's better to store the image on disk as a .jpg and store the path to the
image in the database.

You then display the image in an image control by setting the
ImageControl.Picture="path.jpg"

I think I've got the syntax right.

Rod
 
Back
Top