Hi everyone,

I am using Delphi 7.

I am using a TADOConnection object and some design-time TADOQuery objects.

A my procedure works starting by

   MyAdoConnection.BeginTrans();

and ending by

  MyAdoConnection.CommitTrans();


In the block there is a MyADOQuery object for which I use (becaus of sometimes 
it can generate DB exceptions)

try
   MyADOQuery.ExecSQL();
except
end;


My problem is that when MyADOQuery.ExecSQL() generates an exception, the 
transaction is automatically closed.

I say that because my pascal-like code is

MyAdoConnection.BeginTrans();
try
   Insert in a MyTable1

   for each row on a MyTable2
     do Insert in a MyTable3 through
       a) preparing MyADOQuery
       b) executing MyADOQuery by       
         try
             MyADOQuery.ExecSQL();
         except
         end;

   MyAdoConnection.CommitTrans();
except
   MyAdoConnection.RollbackTrans();
end;


and, when MyADOQuery.ExecSQL(); generates an exception for some row, the same 
happens for all following rows,
but for the following rows it is because MyTable3 has a reference to the row 
initially inserted in MyTable1, which is
like disappeared (my explanation is simply that the transaction is 
automatically closed with a Rollback before
continuing the for cycle).

Do someone knows if there is some property which I should set to avoid the 
automatic rollback on the transaction?

Do you need some other detail?


Best Regards,
Mauro Russo.



  ----------

Questa email รจ stata verificata dal sistema centralizzato antivirus della 
UniPlan Software


[Non-text portions of this message have been removed]



------------------------------------

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [email protected]! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/delphi-en/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to