Oraquery.CachedUpdates:= true; 
Oraquery.SQL.Text:='select * from asa'; 
Oraquery.Open; 
Oraquery.Edit; 
Oraquery.FieldByName(bbb).AsString:= edit2.Text; 
Oraquery.Post; 
Oraquery.Session.StartTransaction; 
Oraquery.Session.Commit; 
Oraquery.CommitUpdates; 我写了半天也没写好,这是在网上找的也不行,dbgrid里看见改过了。在打开窗体数据还是和原来一样。怎么回事?
怎么实现Oraquery的edit?并保存?

解决方案 »

  1.   

    1看来你是要跟新数据
    大可不用那样,直接跟新 update ,使用While not Oraquery.eof do 就OK
      

  2.   

    不是很明白,能说详细点吗?还有。我用了orqry1.Append;
    orqry1.FieldByName('aaa').Value:=1;
    orqry1.FieldByName('bbb').Value:=1;
    orqry1.Post;为何不能保存?要怎样做才能保存?
      

  3.   

    一:跟新数据
    Oraquery.SQL.Text:= 'select   *   from   asa ';   
    Oraquery.Open;   
    Oraquery.Edit;   
    Oraquery.FieldByName(bbb).AsString:=   edit2.Text;   
    Oraquery.Post;   
    操作:1:你是整个字段‘bbb’全部跟新为edit2.Text;2:是把字段‘bbb’满足条件更新为edit2.Text
    两种要求都可以采用:SQl.text:='update table set column='''+Edit1.text+'''' where 条件*****;
    或者 While   not Oraquery.eof  do  
      Begin
       Oraquery.FieldByName(bbb).AsString:=  edit2.Text;
       Oraquery.next;
      End;
    最后全部跟新到数据库
    二:
    还有。我用了 
    orqry1.Append; 
    orqry1.FieldByName('aaa').Value:=1; 
    orqry1.FieldByName('bbb').Value:=1; 
    orqry1.Post; 
    为何不能保存?要怎样做才能保存?
    我试了没有问题,,最好把你的抱错贴出来,,这样好处理