I think you'll find the following will work:-
<%
' Clear out the existing HTTP header information
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
' Change the HTTP header to reflect that an image is being passed.
Response.ContentType = "image/jpeg"
sql = "SELECT PartImage FROM Parts WHERE ShortID='AAPTM01'"
Set rs = AMConn.execute(sql)
If not rs.eof Then
Response.BinaryWrite rs("Partimage")
set rs = nothing
Response.End
else
set rs = nothing
end if
%>
--
Rob Collyer
_______________________________
www.webforumz.com
Free webdesign and development help,
tips, and website critique.
"Nathan Henderson" <na*****@mtannancc.nsw.edu.au> wrote in message
news:OF**************@TK2MSFTNGP11.phx.gbl...
Hi,
Becoming quite frustrated with this.
I have a commercial database written in access and I'm trying to display
some images, jpegs, stored in the DB on web page.
My code is as follows:
Response.ContentType = "image/jpeg"
sql = "SELECT PartImage FROM Parts WHERE ShortID='AAPTM01'"
Set rs = AMConn.execute(sql)
If not rs.eof Then
PicSize = rs("PartImage").ActualSize
if PicSize > 0 then
Response.BinaryWrite
rs("PartImage").GetChunk(rs("PartImage").ActualSiz e)
end if
End If
set rs = nothing
All i get on the page is the image not found icon with the red cross in
IE. What could possibly be going on?
Any suggestions would be appreciated.