怎么正确显示数据库里面的图片?
我用下面的代码显示数据库里面的图片,但是说什么也不成功,什么也显示不出来。请问哪里错了?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%set myconn=server.createobject("adodb.connection")
sConnection ="dsn=vodCust;uid=sa;pwd=uiojkl;"
myconn.Open(sConnection)
set rec=server.createobject("ADODB.recordset")
strsql="select pic from pic where id=2"
rec.open strsql,myconn,1,1
Response.ContentType = "image/*" %>
<%Response.BinaryWrite rec("pic").getChunk(7500000)%>
<%
rec.close
set rec=nothing
set myconn=nothing
%>
</body>
</html>