一个关于文件显示的列了,请大家帮忙实现,谢了

huahaoyueyuan 2003-10-08 09:50:27
我在数据库中插入了一个图片,想用程序把它读出来,可是很一次都读不到,我的数据库中明明有的
表images (1.id(自动编号) 2.img(OLE 对象))
那句SQL语句,我在数据库是执行的话,是可以查询到记录的,可是我在程序中执行就不行,为什么
<a href="showimg.asp">1</a><%

set connGraph=server.CreateObject("ADODB.connection")

dbPath = Server.MapPath ("images.mdb")


connGraph.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & dbPath




set rec=server.createobject("ADODB.recordset")

strsql="select img from images where id=2"

rec.open strsql,connGraph,1,1
if rec.eof then
Response.Write strsql
else
Response.ContentType = "image/*"

Response.BinaryWrite rec("img").getChunk(7500000)

rec.close
end if
set rec=nothing

set connGraph=nothing

%>

...全文
33 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnpr 2003-10-08
  • 打赏
  • 举报
回复
http://www.eaoo.com/design/list.asp?classid=2&Nclassid=8
ttt2 2003-10-08
  • 打赏
  • 举报
回复
<img src="showimg.asp">

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧