In article Q258038 it shows how to read a blob from a
database using ADODB.Stream. I need to do this from asp
without writing a file. Any help would be appreciated.

Re: ADODB and Blobs in asp by Ross

Ross
Thu Jul 31 11:15:00 CDT 2003

"Walter Gray" <wlgray@wal-mart.com> wrote in news:0b0b01c35768$4bd918c0
$a601280a@phx.gbl:

> In article Q258038 it shows how to read a blob from a
> database using ADODB.Stream. I need to do this from asp
> without writing a file. Any help would be appreciated.
>

If all you want to do is read the image and return it as the response, for
example
<IMG SRC="http://server/getimg.asp?id=33">

then you don't need an ADO Stream:

Response.ContentType="image/jpeg"
objRS.Open("SELECT ImageData From Table where ID=33")
Response.BinaryWrite objRS.Fields("ImageData").Value



--
Ross Presser -- rpresser AT imtek DOT com
"... VB is essentially the modern equivalent of vulgar Latin in 13th
Centurary Europe. Understand it, and you can travel to places you never
heard of and still understand some people." -- Alex K. Angelopoulos

Re: ADODB and Blobs in asp by Walter

Walter
Thu Jul 31 16:28:28 CDT 2003

Here is the code you suggested
Response.ContentType="image/gif"
Response.binarywrite rs.Fields("Image_id").value

The rs value works fine with a stream but I get the
following error when tried your way.

Response object, ASP 0106 (0x80020005)
An unhandled data type was encountered.
/wlg/BlobTests/viewimage.asp, line 62

This is line 62
Response.binarywrite rs.Fields("Image_id").value

>-----Original Message-----
>"Walter Gray" <wlgray@wal-mart.com> wrote in
news:0b0b01c35768$4bd918c0
>$a601280a@phx.gbl:
>
>> In article Q258038 it shows how to read a blob from a
>> database using ADODB.Stream. I need to do this from asp
>> without writing a file. Any help would be appreciated.
>>
>
>If all you want to do is read the image and return it as
the response, for
>example
><IMG SRC="http://server/getimg.asp?id=33">
>
>then you don't need an ADO Stream:
>
>Response.ContentType="image/jpeg"
>objRS.Open("SELECT ImageData From Table where ID=33")
>Response.BinaryWrite objRS.Fields("ImageData").Value
>
>
>
>--
>Ross Presser -- rpresser AT imtek DOT com
>"... VB is essentially the modern equivalent of vulgar
Latin in 13th
>Centurary Europe. Understand it, and you can travel to
places you never
>heard of and still understand some people." -- Alex K.
Angelopoulos
>.
>

Re: ADODB and Blobs in asp by Ross

Ross
Fri Aug 01 16:29:16 CDT 2003

"Walter Gray" <wlgray@wal-mart.com> wrote in news:039101c357aa$aedb4b90
$a501280a@phx.gbl:

> Here is the code you suggested
> Response.ContentType="image/gif"
> Response.binarywrite rs.Fields("Image_id").value
>
> The rs value works fine with a stream but I get the
> following error when tried your way.
>
> Response object, ASP 0106 (0x80020005)
> An unhandled data type was encountered.
> /wlg/BlobTests/viewimage.asp, line 62
>
> This is line 62
> Response.binarywrite rs.Fields("Image_id").value
>

Shrug. I don't get an error.

--
Ross Presser -- rpresser AT imtek DOT com