本文主要是介绍ASPnbsp;Blob类型转存为Longnbsp;Raw类型,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、注意,ado驱动不能为MSDAORA.1,否则不能正常读取Blob类型对象,下面采用如下驱动:
Application(
"BitService_ConnectedToDatabase1"
) =
"Provider=OraOLEDB.Oracle.1;user id=tt;password=bitservice;data source=ttonline"
2、相关ASP代码如下;
<百分号
if request.Querystring("getImage")="1" then'初始化对象set conn=server.CreateObject("ADODB.Connection")conn.cursorlocation=3set rs=server.CreateObject("ADODB.Recordset")set rs1=server.CreateObject("ADODB.Recordset")'打开数据库(Provider=OraOLEDB.Oracle.1)conn.open application("BitService_ConnectedToDatabase1")'打开Blob表单l_sqlstr = "select filename,filedesc,filebody from blobTest"rs.open l_sqlstr,conn do while not rs.eof'l_filename=rs("filename")'l_filedesc=rs("filedesc")'l_filebody=rs("filebody")l_filebody = rs.Fields("filebody").GetChunk(rs.Fields("filebody").ActualSize)'response.write "l_filename=" & l_filename & ";l_filedesc=" & l_filedesc & "<br>"response.binarywrite l_filebody'待写入表单l_sqlstr1 = "select * from text_longraw where 1<>1"rs1.open l_sqlstr1,conn, 1,3rs1.Addnewrs1.Fields( "longraw").AppendChunk l_filebody rs1.Updaters1.closers.movenextloop rs.closeconn.close elseresponse.write "<IMG SRC='BLOB_2_LONGRaw.asp?getImage=1'>" end if
百分号>
这篇关于ASPnbsp;Blob类型转存为Longnbsp;Raw类型的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!