adoquery.sql.text:='update table1 set f1=123 where f2=888';
adoquery.execsql;
但进入oracle查到的数据还是原数据!
我想问adoquery怎么提交修改数据?
{adoquery.post也不行 bde中的query有applyupdate事件但ado好像没有 }

解决方案 »

  1.   

    oracle除了update 外还需执行commit;才能提交数据修改的...
      

  2.   

    如果是三层的系统,在POST以后都需要调用APPLYUPDATES函数把缓冲区的数据写回数据库的。
    在你POST后面加上APPLYUPDATES(0)看看
      

  3.   

    再不行就看看你的EXECSQL返回的参数是多少,那是修改记录的数量。
      

  4.   

    adoquery.sql.text:='update table1 set f1="123" where f2="888"';
    adoquery.execsql;加两个引号就OK 了饿。
      

  5.   

    1、自已写SQL提交
    adoquery.sql.text:='update table1 set f1=123 where f2=888';
    adoquery.execsql;
    adoquery.sql.text := 'commit';
    adoquery.execsql;2、用ADOConnection
    if not ADOConnection.InTransaction then ADOConnection.BeginTrans;
    adoquery.sql.text:='update table1 set f1=123 where f2=888';
    try
      adoquery.execsql;
      ADOConnection.CommitTrans;
    except
      ADOConnection.RollbackTrans;
      

  6.   

    adoquery.sql.text:='update table1 set f1=123 where f2=888';
    adoquery.execsql;
    adoquery.sql.text:='commit;
    adoquery.execsql;