A
andywos
Unregistered / Unconfirmed
GUEST, unregistred user!
如下代码加入事务管理怎么写,??????????<br>任何一个出错都要求要回滚<br><br>procedure TForm1.Button4Click(Sender: TObject);<br>begin<br> adoquery1.Close;<br>adoquery1.SQL.Clear;<br>adoquery1.SQL.Add('select * from Employees');<br>adoquery1.Open;<br>adoquery1.Append;<br>adoquery1.FieldByName('lastname').AsString:=edit1.Text;<br>adoquery1.FieldByName('firstname').AsString:=edit2.Text;<br>adoquery1.FieldByName('title').AsString:=edit3.Text;<br>adoquery1.FieldByName('titleofcourtesy').AsString:=edit4.Text;<br>adoquery1.Post;<br><br>adoquery1.Close;<br>adoquery1.SQL.Clear;<br>adoquery1.SQL.Add('delete from Employees where lastname='+'''eeee''');<br>adoquery1.ExecSQL;<br><br>adoquery2.Close;<br>adoquery2.SQL.Clear;<br>adoquery2.SQL.Add('select * from AA');<br>adoquery2.Open;<br>adoquery2.Append;<br>adoquery2.FieldByName('AA').AsString:=edit1.Text;<br>adoquery2.FieldByName('BB').AsString:=edit2.Text;<br>adoquery2.FieldByName('CC').AsString:=edit3.Text;<br>adoquery2.FieldByName('DD').AsString:=edit4.Text;<br>adoquery1.Post;<br><br>end;<br>马上给分