[求助]怎样把数据库里的图片调出来?
"products"是数据源
"images"是数据表
"images"数据表只有两个字段,"id"和"img ",我把图片存储在"img ",但是用 img arc="127.0.0.1/tp.asp?id=1" 确不能打开图片,请大家帮我看看下面这段代码问题出在哪里?
谢谢!
[tp.asp]
<%
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open "products"
set rec=server.createobject("ADODB.recordset")
strsql="select img from images where id=" & trim(request("id"))
rec.open strsql,objConn,1,1
Response.ContentType = "image/*"
Response.BinaryWrite rec("img").getChunk(7500000)
rec.close
set rec=nothing
%>
[此贴子已经被作者于2006-9-11 15:57:58编辑过]