Are you loosing the connection to the database or to
IBSQL1?
To perform a commit (or a rollback) closes all tables the transaction is 
connected to.
That behaveour is by design.

Have fun
Bob
 
*********** Am 14.04.2010 20:48:12 schrieb ihnen c80840 <c80...@gmail.com> 
***************
>     
>     Can someone tell me why I keep loosing connection to the database?
>     
>     
>     procedure TForm3.ThisCommand1Click(Sender: TObject);
>     begin
>         datamodule2.IBSQL1.SQL.Clear;
>         
> datamodule2.IBSQL1.SQL.Add(datamodule2.IBTable2.FieldByName('commands_').AsString+';');
>         if datamodule2.IBSQL1.Transaction.Active = true then
>         begin
>             datamodule2.IBSQL1.Transaction.Rollback;
>         end;
>         datamodule2.IBSQL1.Transaction.StartTransaction;
>         datamodule2.IBSQL1.Prepare;
>         if (datamodule2.IBSQL1.Prepared = true) then
>         begin
>             datamodule2.IBSQL1.ExecQuery;
>             datamodule2.IBSQL1.Transaction.CommitRetaining;
>             // I've also tried: 
> datamodule2.IBSQL1.Transaction.CommitRetaining;
>             // I lose the connection to the database on either
>         end;
>     end;

Reply via email to