FP w/Access Database

J

John

Howdy.

I am trying to implement a searchable Access database with
FP. I have most of it done and working correctly, however
I cannot get pictures to work properly with it. In Access,
the data type is an OLE object. I initially received
#BINARY# in each picture field when I attempted to bring
up the database on the web (pictures are viewable in the
Access database when b4rought up in Access) until I found
this article from MS:

http://support.microsoft.com/default.aspx?
scid=/support/frontpage/fp2000/aspweb/page00010.asp

I followed these directions, and started putting the
pictures in the images folder, but now I receive the
picture broken link image. Does anyone know what's going
on? Thank you in advance.
 
J

Jim Buyens

-----Original Message-----
Howdy.

I am trying to implement a searchable Access database
with FP. I have most of it done and working correctly,
however I cannot get pictures to work properly with it.
In Access, the data type is an OLE object. I initially
received #BINARY# in each picture field when I attempted
to bring up the database on the web (pictures are
viewable in the Access database when b4rought up in
Access) until I found this article from MS:

http://support.microsoft.com/default.aspx?
scid=/support/frontpage/fp2000/aspweb/page00010.asp

I followed these directions, and started putting the
pictures in the images folder, but now I receive the
picture broken link image. Does anyone know what's going
on? Thank you in advance.

I'm not familiar with that article, but I tried it and it
didn't work for me either. Maybe I need to mess with it
some more, but this is the article I've seen work:

175261 HOWTO: Retrieve Bitmap from Access and Display It
in Web Page

http://support.microsoft.com/default.aspx?scid=kb;en-
us;175261

I admit, however, that this article is difficult to
implement. The normal approach is to:

1. Put the picture files in some folder.
2. Put the picture *filenames* in the database.
3. Rig an Access or DRW Custom Query to format an <img>
tag around the filename.
4. Configure the Database Column Value with Column Value
Contains HTML.

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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
J

John

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?
Thanks in advance!
 
J

Jim Buyens

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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 

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