28,391
社区成员
发帖
与我相关
我的任务
分享
Dim WIS_Stm As ADODB.Stream
Dim WIS_Rs As ADODB.Recordset
Dim str_DateID As String
'读取文件到内容
Set WIS_Stm = New ADODB.Stream
WIS_Stm.Type = adTypeBinary '二进制模式
WIS_Stm.Open
WIS_Stm.LoadFromFile App.Path & "\tem.jpg"
'打开文件表
Set WIS_Rs = New ADODB.Recordset
....
WIS_Rs.AddNew
WIS_Rs.Fields("DateID") = str_DateID
....
WIS_Rs.Fields("IPicture") = WIS_Stm.Read
WIS_Rs.Update
WIS_Rs.Close
WIS_Stm.Close
<html>
<head></head>
<body>
显示库中ID为1的图片
<img src='p.asp?DateID=2011-04-27 20:21:18@'>
</body>
</html>
<html>
<head>
</head>
<body>
显示库中ID为1的图片
<script>
document.write("<img src=\"p.asp?DateID="+escape('2011-04-27 20:21:18@')+"\">")
</script>
</body>
</html>
<%
set conngraph=server.createobject("adodb.connection")
''''''''conngraph.connectionstring="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("images.mdb")
conngraph.connectionstring="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("IssueC.mdb")
conngraph.open
set rec=server.createobject("adodb.recordset")
strsql="select IPicture from IssueChart where DateID='"&trim(request("DateID"))&"'"
rec.open strsql,conngraph,1,3
response.contenttype = "image/*"
response.binarywrite rec("IPicture")
rec.close
set rec=nothing
conngraph.close
set conngraph=nothing
%>