Board index » delphi » Transaction erro - Access 97

Transaction erro - Access 97

Hi !

I have the code :

Procedure AfterPost;
begin

     With Qry_1
     begin
                try
                       DataBase.StartTransaction;
                      ApplyUpdates;

                     Qry_2.Close;
                     Qry_2.Sql.Clear;
                     Qry_2.sql.Add('update tabela2 ........');
                     Qry_2.ExecSql;
<-------------------------------Error
                      DataBase.Commit;
             except
                    DataBase.RoolBack;
           end;

     end;
end;

 the error is showing message " Confirm or undo a transaction before user
Begin trans."

Access 97 and Delphi 5.0

 

Re:Transaction erro - Access 97


  I'm not sure, but could the problem be that you call Qry_2.Close while in
the transaction?  Just to check, I'd try moving it to before
StartTransaction.  I prefer to Close my queries immediately after use, not
immediately before their next use.  Calling Close just before using the
query again is just a safety to make sure the query is not already open.
Not the best design, in my book.  Let me know if moving it outside the
transaction helps, ok?
-Howard

Re:Transaction erro - Access 97


Eu tenho um problema similar, ocorrendo ao executar um raise numa transa??o.
A partir deste momento ao executar a query pela segunda vez ocorre: acc0parm
not exist.

 I have a similar problem, happening when executing a raise in a
transaction.
 Starting from this moment when executing the query for the second time
happens: acc0parm not exist.

Other Threads