Display Pictures from Access database

C

CJ

I have an access database located in the fpdb subfolder of my web site. One
of the fields contains an image - this image is actually stored within the
Access database, rather than being a file stored outside the database.

I want my Database Results wizard to show this picture automatically, but
all I get is << BINARY >> instead of the picture.

I found lots of help on the web about displaying pictures located outwith
the database, but this isn't what I want.

The page is located at http://www.mymea.co.uk/fred/searcha.asp

Many thanks.

CJ
 
C

CJ

I found lots of help on the web about displaying pictures located outwith
the database, but this isn't what I want.

The page is located at http://www.mymea.co.uk/fred/searcha.asp

Many thanks.

Please ignore, I found the answer:

When working with an Access OLE Object field, you are working with binary
data. Therefore you can't use the typical "Response.Write..." to display an
image stored in the database. It's really rather tricky to do, as the
database also stores a header in the field which indicates what type of
object is stored in it. In order to even work with the data, you have to
first strip out the header. The only way to do this at this point is to
build a custom COM object that strips out the header and returns a binary
stream. The problem with this (aside from having to write a custom COM
object) is getting your hosting service to register the COM object on their
server. Hosting services are not particularly fond of registering 3rd-party
COM objects on their servers.

The best thing to do if you can, is to store the images in a file on your
web, ad store the paths to the images in your database. Then you can use the
path from the database to dynamically build an image source tag.

CJ
 
X

xmas

Hi CJ,

It really is easier than all that...

http://office.microsoft.com/assista...ID=HA010346811033&CTT=6&Origin=EC010553071033

The images are put in the images folder and the database retrieves them
and inserts them in the page..

If you have acrobat Reader you might find this links page of interest.
(a zipped PDF File)

www.xmas-i-am.com/flash/fplinks.zip

xmas
=============================
| > I found lots of help on the web about displaying pictures located
outwith
| > the database, but this isn't what I want.
| >
| > The page is located at http://www.mymea.co.uk/fred/searcha.asp
| >
| > Many thanks.
| >
|
| Please ignore, I found the answer:
|
| When working with an Access OLE Object field, you are working with binary
| data. Therefore you can't use the typical "Response.Write..." to display
an
| image stored in the database. It's really rather tricky to do, as the
| database also stores a header in the field which indicates what type of
| object is stored in it. In order to even work with the data, you have to
| first strip out the header. The only way to do this at this point is to
| build a custom COM object that strips out the header and returns a binary
| stream. The problem with this (aside from having to write a custom COM
| object) is getting your hosting service to register the COM object on
their
| server. Hosting services are not particularly fond of registering
3rd-party
| COM objects on their servers.
|
| The best thing to do if you can, is to store the images in a file on your
| web, ad store the paths to the images in your database. Then you can use
the
| path from the database to dynamically build an image source tag.
|
| CJ
|
|
 
C

CJ

The images are put in the images folder and the database retrieves them
and inserts them in the page..

Thanks, that's what I'd concluded - the images are stored outside the
database rather than as an OLE object inside it. The database instead
contains just the filename of the image as a text field, and the web page
drags the image from the images folder when the results wizard runs.

That's not ideal for my purposes, because the images have to be part of the
database for another reason, and it just seemed logical to use them from
there rather than create them again on the web server.

Thanks again.

CJ
 
C

chris leeds

while it's not the db wizard, I have a script in php that pulls images from
an mysql database and writes them onto the page. i could copy the page that
does this for you.
 
C

CJ

while it's not the db wizard, I have a script in php that pulls images from
an mysql database and writes them onto the page. i could copy the page that
does this for you.

Thanks, but the databse I have is already in Access.

CJ
 
Top