From a79ac546e5701366755641cc33dbdac87767255b Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 11 Jan 2008 20:39:23 +0000 Subject: [PATCH] Fix bug #1856457 "Incorect table creation queries / wrong error handling" Solution: Just keep CreateTableForm open after firing a faulty CREATE TABLE statement. Note: The "Create" button has ModalResult := mrOK, so the form is automatically closed in the normal case. --- source/createtable.pas | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/createtable.pas b/source/createtable.pas index 45095fb1..961a61f8 100644 --- a/source/createtable.pas +++ b/source/createtable.pas @@ -243,12 +243,13 @@ begin // Execute CREATE statement and reload tablesList try Mainform.Childwin.ActiveDatabase := DBComboBox.Text; - Mainform.ChildWin.ExecUpdateQuery( createQuery ); + Mainform.ChildWin.ExecUpdateQuery( createQuery, False, True ); Mainform.ChildWin.MenuRefreshClick(sender); Mainform.ChildWin.SelectedTable := EditTablename.Text; Mainform.ChildWin.ShowTable(EditTablename.Text); - Close; - except on E: THandledSQLError do; + except on E: THandledSQLError do + // Keep the form open so the user can fix his faulty input + ModalResult := mrNone; end; end;