怎样在ASP+VBSCRIPT判断oracle数据库中二进制记录是否为空
htys3 2003-03-05 11:39:58 我的一段代码:
<%
Dim conn,dnstemp
set conn=server.createobject("adodb.connection")
dnstemp="Provider=OraOLEDB.Oracle;Persist Security Info=False;User ID=test;password=ok;Data Source='(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = home)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = test) ))'"
conn.Open dnstemp
DIM id0
DIM SQL0,RS0
id0=Request.querystring("id")
SQL0="SELECT picture FROM picturetable where picname=" & "'" & id0 & "'"
set RS0=server.CreateObject("adodb.recordset")
RS0.open SQL0,conn,3,2
if CStr(RS0("picture"))=null then '如果picture字段没有值的话,这里老显示数据类型不匹配,RS0("picture")得值得到为ERROR ,有值的时候能正常显示
Response.Write("没有图片信息")
else
response.contenttype="image/gif"
Response.BinaryWrite RS0("picture").GetChunk(7500000)
end if
RS0.close
set RS0=nothing
%>
我的要求是在oracle中读图片如果有图片在页面上显示,没有图片则显示“没有图片信息”,谢谢各位的赐教先