请教各位高手!!!1

horsedy 2002-04-02 09:49:47
请各路大侠帮我一个忙,如何用ASP来把数据库中的图片在网页上显示???
谢谢!!!
...全文
34 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sook_l 2002-04-03
  • 打赏
  • 举报
回复
这要看你使用的什么数据库!用MS的,没有问题。

要用Oracle,Good Luck!

:-)
horsedy 2002-04-03
  • 打赏
  • 举报
回复
谢谢大家的帮助,我试一试
8988 2002-04-02
  • 打赏
  • 举报
回复
<%
'通过ID或文件名读取数据库中图片数据。

'程序名:picshow.asp

'用法:
'<IMG SRC="PicShow.asp?ID=3>
'<IMG SRC="PicShow.asp?Filename=test.gif>

'注意:数据库定义如下
'数据库文件名: upload.mdb
'数据表名: Upload
'字段名:
' ID 编号
' Filename文件名
' ImageValue图片数据


id=Request.QueryString("ID")
name=Request.QueryString("Filename")
if id="" and name="" then response.end
if id="" then
wh="FileName=' & name & "'"
else
wh="ID=" & id
end if

Set conn=Server.CreateObject("ADODB.Connection")
DbPath = Server.mapPath("upload.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
Set rs=Server.Createobject("ADODB.Recordset")
rs.Open "Select * From Upload where " & wh,conn,1
if not rs.EOF then
Response.ContentType = "*/*"
Response.BinaryWrite rs("ImageValue")
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
aspboys 2002-04-02
  • 打赏
  • 举报
回复
here
http://stady.51.net/webnet/asp/tech/01110503.htm

28,405

社区成员

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

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