Nested Transaction in ADO ?
Hello every body !
Is it possible to have nested Transaction in ADO Connections ?
I Tried that but recive this error "Only One Transaction may be ...."
(I use Delphi5 with ADO connection to SQL Server 7.0)
............................................................................
if it is not possible , why, in the following code, the First query dose not
work ?
but the second one runs peroperly. Means that [ExecSQL] runs with no error,
but no Employee is created, but [EmployeeID] of [Jobs] table sets to 999.
***********************************************************
MainConnection.BeginTrans ;
try
with Temp_Qry do
begin
Active := FALSE;
Sql.Clear;
Sql.Add ('INSERT [Employee] (EmployeeID, Name) VALUES
(999,'Jack')')
ExecSQL;
end;
with Temp_Qry do
begin
Active := FALSE;
Sql.Clear;
Sql.Add ('update [Jobs] Set EmployeeID= 999')
ExecSQL;
end;
MainConnection.CommitTrans;
except
MainConnection.RollbackTrans;
end;