我用下面这段代码对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

解决方案 »

  1.   

    Rst.Open SQL, Conn, adOpenStatic, adLockPessimistic, adCmdText
    mstream.Type = adTypeBinary
    rs!question = "这是为什么?"
    rs!imageID = 4000
    rs!Picture = mstream.Read
    rs.Update
    mstream.Close
      

  2.   

    rs.update删除
    rs.UpdateBatch改为rs.update
      

  3.   

    Set rs = con.Execute("select * from tb1 where imageID=4000")改为rs.open "select * from tb1 where imageID=4000",con,3,3
      

  4.   

    可能我没说清,imageID是access表里的主键.
    to golden24kcn(不甜) 
    提示大意由于将在索引,主关键字或关系表中创建重复的值,请求对表的改动没有成功.
      

  5.   

    据我的理解,用execute得到的rs不能用addnew,delete,update方法要用sql语句对表操作,
    使用rs.open方式能支持addnew,delete,update方法
      

  6.   

    zhangqs(zhangqs) 说的对,
     不过还有一个关键的地方是,把rs!ITemId=4001去掉.
      

  7.   

    麻烦!
    这样代替即可con.execute"update from tb1 set question ='这是为什么?',
     Picture =" & mstream.Read & " where imageID=4000"