|
本帖最后由 auto 于 2012-12-5 17:22 编辑
在ASP中 赋值语句 rs.Fields("Content").value=Empty, 如何改写到AU3
附asp源码。。。
发现au3中数据播入数据失败是BLOB等 字段需要对该 字段初始化。。在asp中可以初始化。。
在AU3不知道怎么修改?
试过rs.Fields("Content").value="Empty"也不行。。。
empty 是 BLOB一个特殊值。。不等于空。。也不等于NULL
<!-- #include file="connection.asp" -->
<%
id=trim(session("lw_id"))
'img_num=cint(session("img_num"))
img_num=1
Response.Expires=0
varByteCount = Request.TotalBytes
bnCRLF = chrB( 13 ) & chrB( 10 )
binHTTPHeader=Request.BinaryRead(varByteCount)
Divider = LEFTB( binHTTPHeader, INSTRB( binHTTPHeader, bnCRLF ) - 1 )
binHeaderData = LeftB(binHTTPHeader, INSTRB( binHTTPHeader, bnCRLF & bnCRLF )-1)
'判断文件数据时候开始
DataStart = INSTRB( binHTTPHeader, bnCRLF & bnCRLF ) + 4
DataEnd = INSTRB( DataStart + 1, binHTTPHeader, divider ) - DataStart
binFieldValue=MIDB( binHTTPHeader, DataStart, DataEnd )
'--插入空记录
sqlstr="select * from oa_lw_img"
set rs=myconn.createdynaset(sqlstr,0)
Set PartImage = rs.Fields("content").Value
Do Until rs.EOF
rs.DbDelete
rs.DbMoveNext
Loop
rs.AddNew
' rs.Fields("xh").value=222
rs.Fields("id").value="122"
rs.Fields("Content").value=Empty
rs.Update
rs.movelast
bytelength=lenb(binFieldValue)
'--- 插入BLOB
rs.edit
amount_written = PartImage.Write(binFieldValue)
rs.update
'----取BLOB
rs.movelast
amount_read = PartImage.Read(binFieldValue1)
'Response.ContentType = "image/jpeg"
Response.Write("<br>插入前数据----------------------<br>")
' Response.BinaryWrite(binFieldValue)
for i=1 to bytelength-1
aa=asc(MIDB(binFieldValue,i,i+1))
i=i+1
Response.Write aa&"+"
next
Response.Write("<br>数据库中取出数据----------------------<br>")
' Response.BinaryWrite(binFieldValue1)
for i=1 to amount_read-1
bb=asc(MIDB(binFieldValue1,i,i+1))
i=i+1
Response.Write bb&"+"
next
' Response.Write(bytelength)
' Response.Write("<br>----------------------")
' Response.Write(amount_written)
' Response.Write("<br>----------------------")
' response.BinaryWrite(binFieldValue)
rs.close
set rs=Nothing
myconn.Close
set myconn=Nothing
%> |
|