如何用ASP中读取ORACLE的BLOB字段中的图片

241219 2008-03-23 03:57:06
图片已经存了在oracle数据中,现在要读取出来,不知道大家有什么办法?

分不够可以再加,谢谢了.
...全文
106 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnchart 2008-03-23
  • 打赏
  • 举报
回复
Response.ContentType = "image/jpg"
Response.AddHeader "Content-Disposition", "attachment;filename=test.jpg"
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=OraOLEDB.Oracle.1;Data Source=oradb;","user","pwd"
set rs=server.createObject("ADODB.Recordset")
sql="select img,no from sp_tb where no='9937'"
rs.open sql,conn,1,1
Response.BinaryWrite(rs("img"))

测试平台
oracle10g+win2003+IIS6
img是blob字段
241219 2008-03-23
  • 打赏
  • 举报
回复
我用过这种方法,不行:
<%
id=request("id")
Response.Expires=0
Response.Buffer = true
Response.Clear
Response.ContentType = "image/jpeg" '关键的代码,传送走的文件类型在此指定,
SQL = "select * from picture where id="& id
Rs.Open SQL,Conn,3
Response.BinaryWrite Rs("Lpic") '关键的代码,图片靠此语句显示
Rs.Close
Set Rs = Nothing
%>

28,391

社区成员

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

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