我用下面这段代码对imageId为4000的记录进行更新,可是总更新不了,
提示, Current Recordset does not support updating.This may be a limitatiion of the provider,or of the selected locktype.
我把rs.lockType的四个属性都试了一次,也没有成功的.这是为什么?? mstream.Open
mstream.LoadFromFile "e:\13.jpg"
'ÏÈ°Ñimageid=4000µÄ¼Ç¼ÕÒ³öÀ´
Set rs = con.Execute("select * from tb1 where imageID=4000")
rs.update
rs!question = "这是为什么?"
rs!imageID = 4000
rs!Picture = mstream.Read
rs.UpdateBatch
mstream.Close
提示, Current Recordset does not support updating.This may be a limitatiion of the provider,or of the selected locktype.
我把rs.lockType的四个属性都试了一次,也没有成功的.这是为什么?? mstream.Open
mstream.LoadFromFile "e:\13.jpg"
'ÏÈ°Ñimageid=4000µÄ¼Ç¼ÕÒ³öÀ´
Set rs = con.Execute("select * from tb1 where imageID=4000")
rs.update
rs!question = "这是为什么?"
rs!imageID = 4000
rs!Picture = mstream.Read
rs.UpdateBatch
mstream.Close
mstream.Type = adTypeBinary
rs!question = "这是为什么?"
rs!imageID = 4000
rs!Picture = mstream.Read
rs.Update
mstream.Close
rs.UpdateBatch改为rs.update
to golden24kcn(不甜)
提示大意由于将在索引,主关键字或关系表中创建重复的值,请求对表的改动没有成功.
使用rs.open方式能支持addnew,delete,update方法
不过还有一个关键的地方是,把rs!ITemId=4001去掉.
这样代替即可con.execute"update from tb1 set question ='这是为什么?',
Picture =" & mstream.Read & " where imageID=4000"