Skip to content

Commit 87e3c08

Browse files
committed
feat: select just created table copy
Refs #131
1 parent a777202 commit 87e3c08

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

source/copytable.pas

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ procedure TCopyTableForm.btnOKClick(Sender: TObject);
358358
Key: TTableKey;
359359
ForeignKey: TForeignKey;
360360
ClausePattern: String;
361+
NewObj: TDBObject;
361362
begin
362363
// Compose and run CREATE query
363364

@@ -487,7 +488,13 @@ procedure TCopyTableForm.btnOKClick(Sender: TObject);
487488
end;
488489
// actRefresh takes care of whether the table editor is open
489490
// See also issue #1597
490-
MainForm.actRefresh.Execute
491+
MainForm.actRefresh.Execute;
492+
// Select it in tree
493+
NewObj := TDBObject.Create(FDBObj.Connection);
494+
NewObj.NodeType := lntTable;
495+
NewObj.Database := comboDatabase.Text;
496+
NewObj.Name := editNewTablename.Text;
497+
MainForm.ActiveDbObj := NewObj;
491498
except
492499
on E:EDbError do begin
493500
Screen.Cursor := crDefault;

0 commit comments

Comments
 (0)