"Jeff Cochran" <jeff.nospam@zina.com> wrote in message
news:43f9ad69.323407828@msnews.microsoft.com...
> On Mon, 20 Feb 2006 10:50:20 -0000, "Sean" <nospam@here.com> wrote:
>
>>I need to retrieve a small GIF stored in a SQL server Image field and
>>display it on an ASP page.
>>
>>I have a wrapper page to return the image which I call from another page
>>like this. :
>>
>><img src="image_wrap.asp?ProdID=47">
>>
>>The code to retrieve the image doesn't seem to work, all i get is a
>>default
>>image place holder and no image. The image is definately in the DB and in
>>GIF format. I can pull the images just fine in Access. I tried a few
>>different methods all of which only return an image place holder each
>>time.
>>
>>Any ideas much appreciated.
>>
>>image_wrap.asp
>>===========
>><%
>>
>> Dim iProductID
>> iProductID = Request.QueryString("ProdID")
>>
>> Dim objConn, objRS, strSQL
>> strSQL = "SELECT Image FROM Products WHERE ProdID = " & iProductID
>>
>> Set objConn = Server.CreateObject("ADODB.Connection")
>> objConn.Open "dsn=dsn3;uid=me;pwd=secret;"
>>
>> Set objRS = Server.CreateObject("ADODB.Recordset")
>> objRS.Open strSQL, objConn
>>
>> Response.ContentType = "image/gif"
>> Response.BinaryWrite objRS("Image")
>>
>> objRS.Close
>> Set objRS = Nothing
>> objConn.Close
>> Set objConn = Nothing
>>
>>%>
>
>
> Take a look at:
>
>
http://www.aspfaq.com/show.asp?id=2149 >
> Jeff
not working. I also tried a couple of the other methods.
storing them in SQL. The code appears to work, the image is being retreived,