日期:2014-05-17  浏览次数:21012 次

update语句操作二进制有问题,该如何写
表a(id,图片一,图片二)
下面语句update有问题 该如何写?
<%response.buffer=true
formsize=Request.TotalBytes
formdata=request.binaryread(formsize)
bncrlf=chrB(13)&chrB(10)
divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1)
datastart=instrb(formdata,bncrlf&bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
mydata=midb(formdata,datastart,dataend)
set rec=server.createobject("ADODB.recordset")
sql="update a set 图片二='"&mydata&"'mydata where id="& Request.QueryString("id")
rec.Open sql,session("connection_string"),3,3
rec.close
set rec=nothing

------解决方案--------------------
Access: 将字段的类型设为“OLE对象”
VBScript code

set rec=server.createobject("ADODB.recordset")
sql="SELECT * FROM TableName"
rec.Open sql,session("connection_string"),3,3
rec.AddNew
rec("id") = Request.QueryString("id")
rec("图片二").appendchunk mydata
rec.close
set rec=nothing