diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 532dbe7a..16a2d0d4 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -4451,6 +4451,7 @@ begin Size := s.Size; FCreateCode := s.FCreateCode; FCreateCodeFetched := s.FCreateCodeFetched; + FViewSelectCode := s.FViewSelectCode; end else inherited; end; diff --git a/source/main.pas b/source/main.pas index d37ae228..3455e871 100644 --- a/source/main.pas +++ b/source/main.pas @@ -6793,7 +6793,8 @@ begin actDataPostChangesExecute(DataGrid); DBObj := Sender.GetNodeData(Node); - FActiveDbObj := DBObj^; + FActiveDbObj := TDBObject.Create(DBObj.Connection); + FActiveDbObj.Assign(DBObj^); case FActiveDbObj.NodeType of lntNone: begin @@ -6861,7 +6862,7 @@ begin ShowStatusMsg(FActiveDbObj.Connection.Parameters.NetTypeName(FActiveDbObj.Connection.Parameters.NetType, False)+' '+FActiveDbObj.Connection.ServerVersionStr, 3); end else begin LogSQL('DBtreeFocusChanged without node.', lcDebug); - FActiveDbObj := nil; + FreeAndNil(FActiveDbObj); MainTabToActivate := tabHost; tabHost.Caption := 'Host'; tabDatabase.Caption := 'Database';