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=3 set 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,3 rs1.Addnew rs1.Fields( "longraw").AppendChunk l_filebody rs1.Update rs1.close rs.movenext loop rs.close conn.close else response.write "<IMG SRC='BLOB_2_LONGRaw.asp?getImage=1'>" end if %>