我在用的有关trans的写法,也不知是否有错请高手指教.<br>procedure BeginTrans;<br>begin<br> try<br> if Gconn.Connected then<br> if not Gconn.InTransaction then <br> Gconn.BeginTrans;<br> except<br> end;<br>end;<br><br>procedure CommitTrans;<br>begin<br> if Gconn.InTransaction then<br> Gconn.CommitTrans;<br>end;<br>procedure RollbackTrans;<br>begin<br> try<br> if Gconn.InTransaction then<br> Gconn.RollbackTrans;<br> except<br> end;<br>end;