Skip to content

Commit 18e9431

Browse files
committed
feat: select just created table copy
Refs #131
1 parent 2bc9d78 commit 18e9431

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
@@ -361,6 +361,7 @@ procedure TCopyTableForm.btnOKClick(Sender: TObject);
361361
Key: TTableKey;
362362
ForeignKey: TForeignKey;
363363
CreateLines: TStringList;
364+
NewObj: TDBObject;
364365
begin
365366
// Compose and run CREATE query
366367

@@ -494,7 +495,13 @@ procedure TCopyTableForm.btnOKClick(Sender: TObject);
494495
end;
495496
// actRefresh takes care of whether the table editor is open
496497
// See also issue #1597
497-
MainForm.actRefresh.Execute
498+
MainForm.actRefresh.Execute;
499+
// Select it in tree
500+
NewObj := TDBObject.Create(FDBObj.Connection);
501+
NewObj.NodeType := lntTable;
502+
NewObj.Database := comboDatabase.Text;
503+
NewObj.Name := editNewTablename.Text;
504+
MainForm.ActiveDbObj := NewObj;
498505
except
499506
on E:EDbError do begin
500507
Screen.Cursor := crDefault;

0 commit comments

Comments
 (0)