John said:
You're right - it wasn't a whole lot of help - but it did
lead me to a new page (article towards the bottom) that
dealt with gif/jpg BLOB images. This is handy because it
identifies that Access actually puts headers into the OLE
object which makes it unviewable when viewed on the web.
The trick is stripping out the headers. I don't suppose
you would know how to do that, would you?
OK, I see you need some more convincing.
When you run a database query that returns string or numeric data,
FrontPage can display it simply by adding the data to the HTML. But
you can't just add a picture to the HTML that way; the browser
wouldn't know what to do with it. You can only add an <img> tag that
tells the browser to retrieve and display a picture.
If the picture bits are in a database, the <img> tag needs to ask the
Web server to run a program that retrieves the picture bits and sends
them to the browser for display. Such an <img> tag would look like
this:
<img src="Bitmap.asp?empno=12345">
So, if the DRW were creating an employee report, you would configure
it to write HTML like this:
<tr>
<td>12345</td>
<td>George Washington</td></td>
<td><img src="Bitmap.asp?empno=12345"></td>
</tr>
When the browser receives this HTML, it asks the Web server to run the
bitmap.asp page on the server, using 12345 as a database lookup key.
The bitmap.asp page server looks up this record, extracts the picture
field, runs it through an Active X control that strips out the OLE
headers, and sends the picture to the browser for display.
MSKB article 175261 gives you the source code for an ActiveX control
that strips out the OLE headers. You wwill need to copy this code into
a VB6 project, compile it as a DLL, and then install the DLL on your
server. Then, you'll need to modify the bitmap.asp page shown in the
same article so it looks up the employee number you specify as an
empno= query string variable. (The sample code always looks up
employee number '1').
So after all this is working, you will run one asp page (and perform
one database retrieval) to generate the main page, then you'll run a
second asp page once for each picture, and each time that second asp
page runs, you'll need to perform another database retrieval.
And after all that, the pictures will be in BMP format, which is a
fat, uncompressed file format, and which not all operating systems can
display.
Now, look how much easier life can be if you store each picture as a
file on the server. You store the name of each employee's picture file
in the database, and make the DRW create code like this.
<tr>
<td>12345</td>
<td>George Washington</td></td>
<td><img src="georgew.jpg"></td>
</tr>
The browser gets this code, requests the picture file just as it does
for any pciture on the Web page, done. No VB6 ActiveX control to
compile and install, no extra asp pages to run, no double-retrieval of
database records. Much easier.
Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*