Selaa lähdekoodia

Node.Parent.OverlayIndex bug fix, Key validation on new table
modified: TurboBird.lpi
modified: main.lrs
modified: main.pas
modified: newtable.lfm
modified: newtable.lrs
modified: newtable.pas

motaz 12 vuotta sitten
vanhempi
commit
0c95263aed
6 muutettua tiedostoa jossa 156 lisäystä ja 135 poistoa
  1. 67 67
      TurboBird.lpi
  2. 6 6
      main.lrs
  3. 1 1
      main.pas
  4. 18 18
      newtable.lfm
  5. 43 43
      newtable.lrs
  6. 21 0
      newtable.pas

+ 67 - 67
TurboBird.lpi

@@ -18,7 +18,7 @@
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="9"/>
       <RevisionNr Value="6"/>
-      <BuildNr Value="1078"/>
+      <BuildNr Value="1080"/>
       <StringTable ProductVersion="0.9"/>
     </VersionInfo>
     <BuildModes Count="1">
@@ -76,8 +76,8 @@
         <UnitName Value="main"/>
         <EditorIndex Value="6"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="404"/>
-        <CursorPos X="42" Y="461"/>
+        <TopLine Value="3656"/>
+        <CursorPos X="1" Y="3676"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -208,10 +208,11 @@
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="NewTable"/>
+        <IsVisibleTab Value="True"/>
         <EditorIndex Value="5"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="285"/>
-        <CursorPos X="13" Y="288"/>
+        <TopLine Value="181"/>
+        <CursorPos X="56" Y="215"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -740,11 +741,10 @@
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="PermissionManage"/>
-        <IsVisibleTab Value="True"/>
         <EditorIndex Value="4"/>
         <WindowIndex Value="0"/>
         <TopLine Value="274"/>
-        <CursorPos X="33" Y="284"/>
+        <CursorPos X="25" Y="289"/>
         <UsageCount Value="172"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -1064,124 +1064,124 @@
     </Units>
     <JumpHistory Count="30" HistoryIndex="29">
       <Position1>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="625" Column="1" TopLine="608"/>
+        <Filename Value="about.pas"/>
+        <Caret Line="7" Column="9" TopLine="4"/>
       </Position1>
       <Position2>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="165" Column="3" TopLine="162"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="115" Column="67" TopLine="102"/>
       </Position2>
       <Position3>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="1851" Column="7" TopLine="1789"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="117" Column="67" TopLine="104"/>
       </Position3>
       <Position4>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="165" Column="3" TopLine="162"/>
+        <Filename Value="createuser.pas"/>
+        <Caret Line="7" Column="71" TopLine="3"/>
       </Position4>
       <Position5>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="668" Column="1" TopLine="651"/>
+        <Filename Value="dbinfo.pas"/>
+        <Caret Line="39" Column="19" TopLine="31"/>
       </Position5>
       <Position6>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="165" Column="3" TopLine="162"/>
+        <Filename Value="dbinfo.pas"/>
+        <Caret Line="40" Column="19" TopLine="32"/>
       </Position6>
       <Position7>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="674" Column="22" TopLine="654"/>
+        <Filename Value="dbinfo.pas"/>
+        <Caret Line="41" Column="19" TopLine="32"/>
       </Position7>
       <Position8>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="165" Column="3" TopLine="162"/>
+        <Filename Value="dbinfo.pas"/>
+        <Caret Line="42" Column="19" TopLine="32"/>
       </Position8>
       <Position9>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="731" Column="5" TopLine="711"/>
+        <Filename Value="dbinfo.pas"/>
+        <Caret Line="41" Column="19" TopLine="32"/>
       </Position9>
       <Position10>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="165" Column="3" TopLine="162"/>
+        <Filename Value="dbinfo.pas"/>
+        <Caret Line="42" Column="19" TopLine="33"/>
       </Position10>
       <Position11>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="679" Column="15" TopLine="663"/>
+        <Filename Value="dbinfo.pas"/>
+        <Caret Line="64" Column="3" TopLine="39"/>
       </Position11>
       <Position12>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="165" Column="3" TopLine="162"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="420" Column="3" TopLine="414"/>
       </Position12>
       <Position13>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="794" Column="15" TopLine="774"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="461" Column="42" TopLine="403"/>
       </Position13>
       <Position14>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="830" Column="15" TopLine="807"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="3676" Column="22" TopLine="3653"/>
       </Position14>
       <Position15>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="100" Column="15" TopLine="86"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="3675" Column="16" TopLine="3653"/>
       </Position15>
       <Position16>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="224" Column="24" TopLine="208"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="1" Column="1" TopLine="1"/>
       </Position16>
       <Position17>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="234" Column="27" TopLine="211"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="189" Column="41" TopLine="160"/>
       </Position17>
       <Position18>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="246" Column="19" TopLine="243"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="1306" Column="45" TopLine="1276"/>
       </Position18>
       <Position19>
-        <Filename Value="about.pas"/>
-        <Caret Line="7" Column="9" TopLine="4"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="3676" Column="8" TopLine="3651"/>
       </Position19>
       <Position20>
-        <Filename Value="newtable.pas"/>
-        <Caret Line="115" Column="67" TopLine="102"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="1" Column="1" TopLine="1"/>
       </Position20>
       <Position21>
-        <Filename Value="newtable.pas"/>
-        <Caret Line="117" Column="67" TopLine="104"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="265" Column="39" TopLine="235"/>
       </Position21>
       <Position22>
-        <Filename Value="createuser.pas"/>
-        <Caret Line="7" Column="71" TopLine="3"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="306" Column="53" TopLine="276"/>
       </Position22>
       <Position23>
-        <Filename Value="dbinfo.pas"/>
-        <Caret Line="39" Column="19" TopLine="31"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="322" Column="64" TopLine="292"/>
       </Position23>
       <Position24>
-        <Filename Value="dbinfo.pas"/>
-        <Caret Line="40" Column="19" TopLine="32"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="344" Column="38" TopLine="314"/>
       </Position24>
       <Position25>
-        <Filename Value="dbinfo.pas"/>
-        <Caret Line="41" Column="19" TopLine="32"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="1" Column="1" TopLine="1"/>
       </Position25>
       <Position26>
-        <Filename Value="dbinfo.pas"/>
-        <Caret Line="42" Column="19" TopLine="32"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="3129" Column="33" TopLine="3109"/>
       </Position26>
       <Position27>
-        <Filename Value="dbinfo.pas"/>
-        <Caret Line="41" Column="19" TopLine="32"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="3826" Column="34" TopLine="3820"/>
       </Position27>
       <Position28>
-        <Filename Value="dbinfo.pas"/>
-        <Caret Line="42" Column="19" TopLine="33"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="3676" Column="6" TopLine="3659"/>
       </Position28>
       <Position29>
-        <Filename Value="dbinfo.pas"/>
-        <Caret Line="64" Column="3" TopLine="39"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="288" Column="13" TopLine="285"/>
       </Position29>
       <Position30>
-        <Filename Value="main.pas"/>
-        <Caret Line="420" Column="3" TopLine="414"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="254" Column="3" TopLine="248"/>
       </Position30>
     </JumpHistory>
   </ProjectOptions>

+ 6 - 6
main.lrs

@@ -3,27 +3,27 @@
 LazarusResources.Add('TfmMain','FORMDATA',[
   'TPF0'#7'TfmMain'#6'fmMain'#4'Left'#3#244#0#6'Height'#3#128#2#3'Top'#3#139#0#5
   +'Width'#3#0#4#13'ActiveControl'#7#6'tvMain'#7'Caption'#6#28'TurboBird Admin '
-  +'for FireBird'#12'ClientHeight'#3'i'#2#11'ClientWidth'#3#0#4#5'Color'#7#7'cl'
+  +'for FireBird'#12'ClientHeight'#3'l'#2#11'ClientWidth'#3#0#4#5'Color'#7#7'cl'
   +'White'#9'Font.Name'#6#4'Sans'#4'Menu'#7#9'MainMenu1'#10'OnActivate'#7#12'Fo'
   +'rmActivate'#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreate'#8'Positi'
   +'on'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.4.0'#0#9'TTreeView'#6'tvMai'
-  +'n'#4'Left'#2#0#6'Height'#3'i'#2#3'Top'#2#0#5'Width'#3'h'#1#5'Align'#7#6'alL'
+  +'n'#4'Left'#2#0#6'Height'#3'l'#2#3'Top'#2#0#5'Width'#3'h'#1#5'Align'#7#6'alL'
   +'eft'#15'BackgroundColor'#7#7'clWhite'#5'Color'#7#7'clCream'#13'HideSelectio'
   +'n'#8#6'Images'#7#10'ImageList1'#6'Indent'#2#25#8'ReadOnly'#9#16'RightClickS'
   +'elect'#9#9'ShowLines'#8#8'TabOrder'#2#0#10'OnDblClick'#7#14'tvMainDblClick'
   +#10'OnExpanded'#7#14'tvMainExpanded'#7'Options'#11#17'tvoAutoItemHeight'#21
   +'tvoKeepCollapsedNodes'#11'tvoReadOnly'#19'tvoRightClickSelect'#14'tvoShowBu'
   +'ttons'#11'tvoShowRoot'#11'tvoToolTips'#0#15'ExpandSignColor'#7#8'clMaroon'#0
-  +#0#9'TSplitter'#9'Splitter1'#4'Left'#3'h'#1#6'Height'#3'i'#2#3'Top'#2#0#5'Wi'
+  +#0#9'TSplitter'#9'Splitter1'#4'Left'#3'h'#1#6'Height'#3'l'#2#3'Top'#2#0#5'Wi'
   +'dth'#2#14#7'Beveled'#9#0#0#12'TPageControl'#12'PageControl1'#4'Left'#3'y'#1
-  +#6'Height'#3'b'#2#3'Top'#2#3#5'Width'#3#132#2#10'ActivePage'#7#9'TabSheet1'#5
+  +#6'Height'#3'e'#2#3'Top'#2#3#5'Width'#3#132#2#10'ActivePage'#7#9'TabSheet1'#5
   +'Align'#7#8'alClient'#18'BorderSpacing.Left'#2#1#17'BorderSpacing.Top'#2#1#19
   +'BorderSpacing.Right'#2#1#20'BorderSpacing.Bottom'#2#2#20'BorderSpacing.Arou'
   +'nd'#2#2#25'BorderSpacing.InnerBorder'#2#1#9'Font.Name'#6#4'Sans'#10'ParentF'
   +'ont'#8#8'TabIndex'#2#0#8'TabOrder'#2#2#17'OnCloseTabClicked'#7#27'PageContr'
   +'ol1CloseTabClicked'#7'Options'#11#20'nboHidePageListPopup'#0#0#9'TTabSheet'
-  +#9'TabSheet1'#11'BorderWidth'#2#1#7'Caption'#6#4'Main'#12'ClientHeight'#3'D'
-  +#2#11'ClientWidth'#3#128#2#10'Font.Color'#7#6'clNavy'#9'Font.Name'#6#5'Arial'
+  +#9'TabSheet1'#11'BorderWidth'#2#1#7'Caption'#6#4'Main'#12'ClientHeight'#3'F'
+  +#2#11'ClientWidth'#3'|'#2#10'Font.Color'#7#6'clNavy'#9'Font.Name'#6#5'Arial'
   +#10'ParentFont'#8#0#7'TBitBtn'#11'bbRestoreDB'#4'Left'#2#3#6'Height'#2']'#3
   +'Top'#3#216#0#5'Width'#3#208#0#7'Caption'#6#16'Restore Database'#5'Color'#7#7
   +'clCream'#9'Font.Name'#6#4'Sans'#10'Glyph.Data'#10':'#16#0#0'6'#16#0#0'BM6'

+ 1 - 1
main.pas

@@ -3673,7 +3673,7 @@ begin
     else  // Expand object
     begin
       tvMainExpanded(nil, Node);
-      Rec:= RegisteredDatabases[Node.OverlayIndex].RegRec;
+      Rec:= RegisteredDatabases[Node.Parent.OverlayIndex].RegRec;
     end;
   end
   else

+ 18 - 18
newtable.lfm

@@ -12,9 +12,9 @@ object fmNewTable: TfmNewTable
   LCLVersion = '1.0.4.0'
   object Label1: TLabel
     Left = 18
-    Height = 15
+    Height = 14
     Top = 9
-    Width = 84
+    Width = 85
     Caption = 'New Table name'
     Font.Height = -11
     ParentColor = False
@@ -22,7 +22,7 @@ object fmNewTable: TfmNewTable
   end
   object edNewTable: TEdit
     Left = 18
-    Height = 27
+    Height = 23
     Top = 28
     Width = 206
     OnKeyUp = edNewTableKeyUp
@@ -100,9 +100,9 @@ object fmNewTable: TfmNewTable
   end
   object cxCreateGen: TCheckBox
     Left = 18
-    Height = 24
-    Top = 496
-    Width = 328
+    Height = 19
+    Top = 501
+    Width = 259
     Anchors = [akLeft, akBottom]
     Caption = 'Create Auto increment Generator and Trigger'
     TabOrder = 4
@@ -122,9 +122,9 @@ object fmNewTable: TfmNewTable
   end
   object cxGrantPermission: TCheckBox
     Left = 16
-    Height = 24
-    Top = 529
-    Width = 64
+    Height = 19
+    Top = 534
+    Width = 49
     Anchors = [akLeft, akBottom]
     Caption = 'Grant'
     OnChange = cxGrantPermissionChange
@@ -132,12 +132,12 @@ object fmNewTable: TfmNewTable
   end
   object cbPermission: TComboBox
     Left = 96
-    Height = 27
-    Top = 526
+    Height = 23
+    Top = 530
     Width = 145
     Anchors = [akLeft, akBottom]
     Enabled = False
-    ItemHeight = 0
+    ItemHeight = 15
     ItemIndex = 0
     Items.Strings = (
       'Full'
@@ -150,9 +150,9 @@ object fmNewTable: TfmNewTable
   end
   object laPermission: TLabel
     Left = 256
-    Height = 18
-    Top = 531
-    Width = 94
+    Height = 16
+    Top = 533
+    Width = 73
     Anchors = [akLeft, akBottom]
     Caption = 'Permission to'
     ParentColor = False
@@ -160,11 +160,11 @@ object fmNewTable: TfmNewTable
   end
   object cbRolesUsers: TComboBox
     Left = 361
-    Height = 29
-    Top = 524
+    Height = 23
+    Top = 530
     Width = 181
     Anchors = [akLeft, akBottom]
-    ItemHeight = 0
+    ItemHeight = 15
     Items.Strings = (
       'Full'
       'Read '

+ 43 - 43
newtable.lrs

@@ -5,9 +5,9 @@ LazarusResources.Add('TfmNewTable','FORMDATA',[
   +#192#0#5'Width'#3'R'#2#13'ActiveControl'#7#10'edNewTable'#7'Caption'#6#9'New'
   +' Table'#12'ClientHeight'#3'j'#2#11'ClientWidth'#3'R'#2#7'OnClose'#7#9'FormC'
   +'lose'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.4.0'#0#6'TLab'
-  +'el'#6'Label1'#4'Left'#2#18#6'Height'#2#15#3'Top'#2#9#5'Width'#2'T'#7'Captio'
+  +'el'#6'Label1'#4'Left'#2#18#6'Height'#2#14#3'Top'#2#9#5'Width'#2'U'#7'Captio'
   +'n'#6#14'New Table name'#11'Font.Height'#2#245#11'ParentColor'#8#10'ParentFo'
-  +'nt'#8#0#0#5'TEdit'#10'edNewTable'#4'Left'#2#18#6'Height'#2#27#3'Top'#2#28#5
+  +'nt'#8#0#0#5'TEdit'#10'edNewTable'#4'Left'#2#18#6'Height'#2#23#3'Top'#2#28#5
   +'Width'#3#206#0#7'OnKeyUp'#7#15'edNewTableKeyUp'#8'TabOrder'#2#0#0#0#11'TStr'
   +'ingGrid'#11'StringGrid1'#4'Left'#2#18#6'Height'#3#163#1#3'Top'#2'B'#5'Width'
   +#3'='#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ColCount'
@@ -29,52 +29,52 @@ LazarusResources.Add('TfmNewTable','FORMDATA',[
   +'TBitBtn'#8'bbScript'#4'Left'#2#18#6'Height'#2'.'#3'Top'#3'0'#2#5'Width'#2'v'
   +#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#6'Script'#5'Color'#4#219
   +#242#247#0#4'Kind'#7#5'bkYes'#7'OnClick'#7#13'bbScriptClick'#8'TabOrder'#2#3
-  +#0#0#9'TCheckBox'#11'cxCreateGen'#4'Left'#2#18#6'Height'#2#24#3'Top'#3#240#1
-  +#5'Width'#3'H'#1#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6'+Create '
-  +'Auto increment Generator and Trigger'#8'TabOrder'#2#4#0#0#7'TBitBtn'#7'bbCl'
-  +'ose'#4'Left'#3'0'#2#6'Height'#2#24#3'Top'#2#0#5'Width'#2#27#7'Anchors'#11#5
+  +#0#0#9'TCheckBox'#11'cxCreateGen'#4'Left'#2#18#6'Height'#2#19#3'Top'#3#245#1
+  +#5'Width'#3#3#1#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6'+Create A'
+  +'uto increment Generator and Trigger'#8'TabOrder'#2#4#0#0#7'TBitBtn'#7'bbClo'
+  +'se'#4'Left'#3'0'#2#6'Height'#2#24#3'Top'#2#0#5'Width'#2#27#7'Anchors'#11#5
   +'akTop'#7'akRight'#0#7'Caption'#6#4' X  '#5'Color'#4#219#242#247#0#10'Font.S'
   +'tyle'#11#6'fsBold'#0#7'OnClick'#7#12'bbCloseClick'#10'ParentFont'#8#8'TabOr'
-  +'der'#2#5#0#0#9'TCheckBox'#17'cxGrantPermission'#4'Left'#2#16#6'Height'#2#24
-  +#3'Top'#3#17#2#5'Width'#2'@'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'
+  +'der'#2#5#0#0#9'TCheckBox'#17'cxGrantPermission'#4'Left'#2#16#6'Height'#2#19
+  +#3'Top'#3#22#2#5'Width'#2'1'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'
   +#6#5'Grant'#8'OnChange'#7#23'cxGrantPermissionChange'#8'TabOrder'#2#6#0#0#9
-  +'TComboBox'#12'cbPermission'#4'Left'#2'`'#6'Height'#2#27#3'Top'#3#14#2#5'Wid'
+  +'TComboBox'#12'cbPermission'#4'Left'#2'`'#6'Height'#2#23#3'Top'#3#18#2#5'Wid'
   +'th'#3#145#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Enabled'#8#10'ItemHeigh'
-  +'t'#2#0#9'ItemIndex'#2#0#13'Items.Strings'#1#6#4'Full'#6#7'Modify '#6#4'Read'
-  +#0#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#7#4'Text'#6#4'Full'#0#0#6'TLa'
-  +'bel'#12'laPermission'#4'Left'#3#0#1#6'Height'#2#18#3'Top'#3#19#2#5'Width'#2
-  +'^'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#13'Permission to'#11
+  +'t'#2#15#9'ItemIndex'#2#0#13'Items.Strings'#1#6#4'Full'#6#7'Modify '#6#4'Rea'
+  +'d'#0#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#7#4'Text'#6#4'Full'#0#0#6
+  +'TLabel'#12'laPermission'#4'Left'#3#0#1#6'Height'#2#16#3'Top'#3#21#2#5'Width'
+  +#2'I'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#13'Permission to'#11
   +'ParentColor'#8#7'Visible'#8#0#0#9'TComboBox'#12'cbRolesUsers'#4'Left'#3'i'#1
-  +#6'Height'#2#29#3'Top'#3#12#2#5'Width'#3#181#0#7'Anchors'#11#6'akLeft'#8'akB'
-  +'ottom'#0#10'ItemHeight'#2#0#13'Items.Strings'#1#6#4'Full'#6#5'Read '#6#6'In'
-  +'sert'#0#8'TabOrder'#2#8#7'Visible'#8#0#0#6'TImage'#6'Image1'#4'Left'#3#192#1
-  +#6'Height'#2'?'#3'Top'#2#0#5'Width'#2'P'#12'Picture.Data'#10#189#10#0#0#23'T'
-  +'PortableNetworkGraphic'#161#10#0#0#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0
-  +'@'#0#0#0'@'#8#6#0#0#0#170'iq'#222#0#0#0#4'sBIT'#8#8#8#8'|'#8'd'#136#0#0#0#9
-  +'pHYs'#0#0#13#215#0#0#13#215#1'B('#155'x'#0#0#0#25'tEXtSoftware'#0'www.inksc'
-  +'ape.org'#155#238'<'#26#0#0#10#30'IDATx'#156#237'[MhU'#219#21#254#214#249#203
-  +#185#215#188#220'h~j'#213#151#196#24'#'#25'X'#131'>H0'#133'V(t'#148'I;'#234
-  +'@'#177'"tP'#138#208'A'#139'#'#133'"'#165#208#161#224#228'U|8'#16#4#235'@'#20
-  +#138#130'P^G'#26#127'jP'#136'6'#228'E^$'#168'Qs'#239'M'#206#239'^'#29#220#187
-  +#239#219#247#228#220#159'sn'#174'B_'#23'l'#206#222#235#236#179#207'^'#223'^{'
-  +#237#181#255#136#153#241'}&'#237'SW'#224'S'#211#255#1#248#212#21#248#212'd'
-  +#180#242'1'#17#17#0'Z\\'#28#176','#235#11'f'#142#5'4'#12#195#186'i'#0#240'}'
-  +#127'qdd'#228'>'#0#193#204#162#149'z%!Jk'#4#151#150#150'vn'#217#178#229'oB'
-  +#136'q!D'#151'Z'#14'3W'#130'L'#215#227#11'! '#132'0'#29#199#249'rll'#236#15#0
-  +#214'P'#2#162#237#22':1'#0'DD'#239#223#191#255'53'#255'E'#8#177'E'#8'AB'#8'R'
-  +#203#147'A'#136#239#26'R'#229#199#129#21#134#161#25#134'!'#28#199#185'=>>'
-  +#254'+'#0#171#0#194'v'#131#144#8#0'"'#162#165#165#165'/l'#219#190#195#204'V'
-  +#24#134'$'#132' f'#150#130#19#128'D'#173#175#0#160#251#190'OB'#8'0'#243#191
-  ,#15#28'8'#240'3'#0#31#0#248#237#4'!'#145#17'<{'#246#172'n'#219#246'WB'#8'+'#8
-  +#2'-'#12'C'#141#153'5'#169#5'eUFY'#8#168#233'F'#252'0'#12#17#134'!'#130' '
-  +#128#231'y?z'#252#248#241'}'#0#219#0#152'e['#211#22'j'#26#0'"'#162#227#199
-  +#143#255'\'#8'1$['#30#128'l'#177#216#22'V'#187'B'#28'_'#205#31#5#162'P('#12
-  +'<x'#240#224#233#238#221#187#127#8#192'"'#162#182#140'XI'#10'%'#211'4'#127
-  +#170#168'<'#133'aXW'#240'Z'#253'='#238#27'!'#4#130' '#168#2'buuu'#235#149'+W'
-  +#158#29'=zt'#31#128#142'v'#128#144#8#0']'#215#15'0sE'#221#155#21'^'#213#130
-  +'zZ'#162'j'#128#2'B'#230#228#201#147#247#207#156'9s'#24#128#189#217' $)Lc'
-  +#230#174'zB&Q'#249'h^)p'#28#8#249'|'#222#156#154#154#250#199#133#11#23'~'#1
-  +' '#187#153' $'#210#128' '#8'*'#234#223#170#202'G'#131#212#0#181#27#200'x'
+  +#6'Height'#2#23#3'Top'#3#18#2#5'Width'#3#181#0#7'Anchors'#11#6'akLeft'#8'akB'
+  +'ottom'#0#10'ItemHeight'#2#15#13'Items.Strings'#1#6#4'Full'#6#5'Read '#6#6'I'
+  +'nsert'#0#8'TabOrder'#2#8#7'Visible'#8#0#0#6'TImage'#6'Image1'#4'Left'#3#192
+  +#1#6'Height'#2'?'#3'Top'#2#0#5'Width'#2'P'#12'Picture.Data'#10#189#10#0#0#23
+  +'TPortableNetworkGraphic'#161#10#0#0#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0
+  +#0'@'#0#0#0'@'#8#6#0#0#0#170'iq'#222#0#0#0#4'sBIT'#8#8#8#8'|'#8'd'#136#0#0#0
+  +#9'pHYs'#0#0#13#215#0#0#13#215#1'B('#155'x'#0#0#0#25'tEXtSoftware'#0'www.ink'
+  +'scape.org'#155#238'<'#26#0#0#10#30'IDATx'#156#237'[MhU'#219#21#254#214#249
+  +#203#185#215#188#220'h~j'#213#151#196#24'#'#25'X'#131'>H0'#133'V(t'#148'I;'
+  +#234'@'#177'"tP'#138#208'A'#139'#'#133'"'#165#208#161#224#228'U|8'#16#4#235
+  +'@'#20#138#130'P^G'#26#127'jP'#136'6'#228'E^$'#168'Qs'#239'M'#206#239'^'#29
+  +#220#187#239#219#247#228#220#159'sn'#174'B_'#23'l'#206#222#235#236#179#207'^'
+  +#223'^{'#237#181#255#136#153#241'}&'#237'SW'#224'S'#211#255#1#248#212#21#248
+  +#212'd'#180#242'1'#17#17#0'Z\\'#28#176','#235#11'f'#142#5'4'#12#195#186'i'#0
+  +#240'}'#127'qdd'#228'>'#0#193#204#162#149'z%!Jk'#4#151#150#150'vn'#217#178
+  +#229'oB'#136'q!D'#151'Z'#14'3W'#130'L'#215#227#11'! '#132'0'#29#199#249'rll'
+  +#236#15#0#214'P'#2#162#237#22':1'#0'DD'#239#223#191#255'53'#255'E'#8#177'E'#8
+  +'AB'#8'R'#203#147'A'#136#239#26'R'#229#199#129#21#134#161#25#134'!'#28#199
+  +#185'=>>'#254'+'#0#171#0#194'v'#131#144#8#0'"'#162#165#165#165'/l'#219#190
+  +#195#204'V'#24#134'$'#132' f'#150#130#19#128'D'#173#175#0#160#251#190'OB'#8
+  ,'0'#243#191#15#28'8'#240'3'#0#31#0#248#237#4'!'#145#17'<{'#246#172'n'#219#246
+  +'WB'#8'+'#8#2'-'#12'C'#141#153'5'#169#5'eUFY'#8#168#233'F'#252'0'#12#17#134
+  +'!'#130' '#128#231'y?z'#252#248#241'}'#0#219#0#152'e['#211#22'j'#26#0'"'#162
+  +#227#199#143#255'\'#8'1$['#30#128'l'#177#216#22'V'#187'B'#28'_'#205#31#5#162
+  +'P('#12'<x'#240#224#233#238#221#187#127#8#192'"'#162#182#140'XI'#10'%'#211'4'
+  +#127#170#168'<'#133'aXW'#240'Z'#253'='#238#27'!'#4#130' '#168#2'buuu'#235#149
+  +'+W'#158#29'=zt'#31#128#142'v'#128#144#8#0']'#215#15'0sE'#221#155#21'^'#213
+  +#130'zZ'#162'j'#128#2'B'#230#228#201#147#247#207#156'9s'#24#128#189#217' $)L'
+  +'c'#230#174'zB&Q'#249'h^)p'#28#8#249'|'#222#156#154#154#250#199#133#11#23'~'
+  +#1' '#187#153' $'#210#128' '#8'*'#234#223#170#202'G'#131#212#0#181#27#200'x'
   +#217'&'#232#3#3#3'_]'#185'r'#229#183#0':'#137'H'#255#216#0#0'@'#211#173#155
   +#180#139#0#168#169#1#10#8#154'a'#24#127#190'v'#237#218#159#0'|FDz'#171'#D"'#0
   +'j'#9#159'F'#229#163'|M'#211#184'^7'#144'O'#199'qhmm'#237'w7o'#222#252#18'@'

+ 21 - 0
newtable.pas

@@ -172,6 +172,7 @@ end;
 function TfmNewTable.Validate: Boolean;
 var
   i: Integer;
+  PKeyFound: Boolean;
 begin
   Result:= False;
   if Trim(edNewTable.Text) = '' then
@@ -195,6 +196,26 @@ begin
       Result:= False;
       MessageDlg('Warning', 'You should select field name for the column number ' + IntToStr(i), mtWarning, [mbOk], 0);
     end;
+
+    // Check Primary key
+    if cxCreateGen.Checked then
+    begin
+      PKeyFound:= False;
+      with StringGrid1 do
+      for i:= 1 to RowCount - 1 do
+      if Cells[4, i] = '1' then
+      begin
+        PKeyFound:= True;
+        Break;
+      end;
+
+      if not PKeyFound then
+      begin
+        Result:= False;
+        MessageDlg('Warning', 'There is no primary key', mtWarning, [mbOk], 0);
+      end;
+
+    end;
   end;
 
 end;