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").ActualSize)
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.

Re: Displaying Img from Access using BinaryWrite by John

John
Sun Jul 18 05:37:40 CDT 2004

http://www.aspfaq.com/show.asp?id=2149



Re: Displaying Img from Access using BinaryWrite by Rob

Rob
Sun Jul 18 06:21:43 CDT 2004

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" <nathanh@mtannancc.nsw.edu.au> wrote in message
news:OFGcFbJbEHA.3480@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").ActualSize)
> 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.
>
>



Re: Displaying Img from Access using BinaryWrite by Nathan

Nathan
Sun Jul 18 06:59:31 CDT 2004

Sorry, didn't work, same prob,

I can't even seem to get it working on a db i have set up myself.
I gather this is the way to insert them: right click on field> insert
object> create from file> select the jpeg. Seems pretty sraight forward but
i cannot for the life of me figure out whats wrong.

any other suggestions??
I really need to get this going.




"Rob" <webforumz@webforumz.com> wrote in message
news:cddmg7$h87$1@titan.btinternet.com...
> 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" <nathanh@mtannancc.nsw.edu.au> wrote in message
> news:OFGcFbJbEHA.3480@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").ActualSize)
> > 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.
> >
> >
>
>



Re: Displaying Img from Access using BinaryWrite by Bã§TãRÐ

Bã§TãRÐ
Tue Jul 27 22:14:09 CDT 2004

This help you at all?


Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open datasourcename

' Create Recordset
Set Disp_img = Server.CreateObject("ADODB.Recordset")
Disp_img.Open "SELECT file_image_blob FROM table_name WHERE
F_ID =" & Request("F_ID"), DataConn, 2, 3

If Not Disp_img.EOF Then
Response.ContentType = "image/jpeg"
Response.BinaryWrite Disp_img("file_image_blob")
End If

Disp_img.Close
Set Disp_img = Nothing

DataConn.Close
Set DataConn = Nothing



Let me know.

- Bastard


On Sun, 18 Jul 2004 21:59:31 +1000, "Nathan Henderson"
<nathanh@mtannancc.nsw.edu.au> wrote:

>Sorry, didn't work, same prob,
>
>I can't even seem to get it working on a db i have set up myself.
>I gather this is the way to insert them: right click on field> insert
>object> create from file> select the jpeg. Seems pretty sraight forward but
>i cannot for the life of me figure out whats wrong.
>
>any other suggestions??
>I really need to get this going.
>
>
>
>
>"Rob" <webforumz@webforumz.com> wrote in message
>news:cddmg7$h87$1@titan.btinternet.com...
>> 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" <nathanh@mtannancc.nsw.edu.au> wrote in message
>> news:OFGcFbJbEHA.3480@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").ActualSize)
>> > 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.
>> >
>> >
>>
>>
>