uid 不存在,只要你的sql语句正确,当然不会报错,只是更新了0行罢了

解决方案 »

  1.   

    是的,sql语句执行是对的,所以sqlca.sqlcode = 0
      

  2.   

    update a set sum = sum + 100 where uid = '1';
    如果没有uid为1的记录,就不更新,语句正确。
      

  3.   

    update a set sum = sum + 100 where uid = '1';   //一个不存在的uid
    if sqlca.sqlcode < 0 then
       messagebox("err","update error!")
       rollback;
       return
    end if
    加update a set sum = sum + 100 where uid = '1' using sqlca;