|
@@ -454,6 +454,8 @@ begin
|
|
if Assigned(Value) then
|
|
if Assigned(Value) then
|
|
Value.Database := Self;
|
|
Value.Database := Self;
|
|
FTransaction := Value;
|
|
FTransaction := Value;
|
|
|
|
+ If Assigned(FTransaction) and (FTransaction.Database=Nil) then
|
|
|
|
+ FTransaction.Database:=Self;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -726,6 +728,9 @@ begin
|
|
with TSQLConnection(DataBase) do
|
|
with TSQLConnection(DataBase) do
|
|
if Transaction = self then Transaction := nil;
|
|
if Transaction = self then Transaction := nil;
|
|
inherited SetDatabase(Value);
|
|
inherited SetDatabase(Value);
|
|
|
|
+ If Assigned(Database) then
|
|
|
|
+ If (TSQLConnection(DataBase).Transaction=Nil) then
|
|
|
|
+ TSQLConnection(DataBase).Transaction:=Self;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -759,6 +764,8 @@ Procedure TCustomSQLQuery.SetTransaction(Value : TDBTransaction);
|
|
begin
|
|
begin
|
|
UnPrepare;
|
|
UnPrepare;
|
|
inherited;
|
|
inherited;
|
|
|
|
+ If (Transaction<>Nil) and (Database=Nil) then
|
|
|
|
+ Database:=TSQLTransaction(Transaction).Database;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TCustomSQLQuery.SetDatabase(Value : TDatabase);
|
|
procedure TCustomSQLQuery.SetDatabase(Value : TDatabase);
|