图片不显示的问题!

洋宝小调皮 2003-05-06 07:22:47
我用的是ASP+ACESS,数据库里的字段类型是OLE的,但在执行INDEX。ASP时却不能正确显示图片,是不是我插数据库的字段不对啊?
index.asp:
<img src="display.asp">

display.asp:
<%
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("laoding.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set rs=server.createobject("ADODB.recordset")
sql="select * from pic"
rs.open sql,conn,1,1
Response.ContentType = "image/jpeg"
Response.BinaryWrite rs("pic")
rs.close
set rs=nothing
set connGraph=nothing
%>
...全文
29 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaolinsyl 2003-05-06
  • 打赏
  • 举报
回复
程序没有问题,请检查一下数据库中是否有记录!!!
cpio 2003-05-06
  • 打赏
  • 举报
回复
不是吧,是不是数据库里面本来就没有图片

28,391

社区成员

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

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