| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 448 人关注过本帖
标题:难到就没人知道这个问题吗 唉???????
只看楼主 加入收藏
lengxue
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-14
收藏
 问题点数:0 回复次数:1 
难到就没人知道这个问题吗 唉???????

asp图片二进制从数据库提出来之后 怎么传到页面显示出来
<%
Response.Expires = 0
response.addHeader "pragma" , "no-cache"
response.addHeader "cache-control" , "private"
Response.buffer=True
Response.clear

op = Request.QueryString("op")
zl = Request.QueryString("zl")

'Reference the Session connection variable
cn = Session("cnn")


'Create recordsets
Set ProductInfo = Server.CreateObject("ADODB.Recordset")

'Create query strings

'Returns products from the Products table that belong to the CategoryID category.
querystr = "SELECT JH,JM,ZJDH,ZJDM,KZZL,TPXX FROM TXJHB where JH = '" & session("wellid") & "'"

'Open the Recordsets
ProductInfo.Open querystr, cn,1,3

ProductInfo("KZZL") = zl

ProductInfo.movefirst

Response.ContentType="image/*"

response.Binarywrite ProductInfo("TPXX").GetChunk(7500000)

ProductInfo.close
%>
<iframe width=0 height=0></iframe><iframe width=0 height=0></iframe>

这是从数据库提出来的 TPXX是图片字段---是Image 类型的
帮帮忙!!!!!!!
给我点显示页面的代码最好!!! 谢谢!!!

搜索更多相关主题的帖子: private Create 数据库 二进制 图片 
2007-06-20 11:53
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
收藏
得分:0 

<%
Function SetForDisplay(field, contentType)

contentType = contentType
nFieldSize = field.ActualSize
bytes = field.GetChunk(nFieldSize)

Session("Bytes") = bytes
Session("Type") = contentType
End Function
%>
<%
SetForDisplay ProductInfo("TPXX"), "image/*"
Set ProductInfo.ActiveConnection = Nothing
%>
<img src="theImg.asp">

theImg.asp
<%
response.Expires = 0
response.Buffer = True
response.Clear
response.contentType = Session("Type")
response.BinaryWrite Session("Bytes")
Session("Type") = ""
Session("Bytes") = ""
response.End
%>

[此贴子已经被作者于2007-6-20 19:14:21编辑过]


其实我就是改变社会风气,提高少女素质,刺激电影市道,提高年轻人内涵,玉树临风,风度翩翩的整蛊专家,我名叫古晶,英文名叫JingKoo!
2007-06-20 19:13
快速回复:难到就没人知道这个问题吗 唉???????
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013442 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved