ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/design/ibdataseteditor.pas
(Generate patch)

Comparing ibx/trunk/design/ibdataseteditor.pas (file contents):
Revision 17 by tony, Sat Dec 28 19:22:24 2013 UTC vs.
Revision 81 by tony, Mon Jan 1 11:31:10 2018 UTC

# Line 1 | Line 1
1 < (*
2 < *  IBX For Lazarus (Firebird Express)
3 < *
4 < *  The contents of this file are subject to the Initial Developer's
5 < *  Public License Version 1.0 (the "License"); you may not use this
6 < *  file except in compliance with the License. You may obtain a copy
7 < *  of the License here:
8 < *
9 < *    http://www.firebirdsql.org/index.php?op=doc&id=idpl
10 < *
11 < *  Software distributed under the License is distributed on an "AS
12 < *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13 < *  implied. See the License for the specific language governing rights
14 < *  and limitations under the License.
15 < *
16 < *  The Initial Developer of the Original Code is Tony Whyman.
17 < *
18 < *  The Original Code is (C) 2011 Tony Whyman, MWA Software
19 < *  (http://www.mwasoftware.co.uk).
20 < *
21 < *  All Rights Reserved.
22 < *
23 < *  Contributor(s): ______________________________________.
24 < *
25 < *)
26 <
27 < unit IBDataSetEditor;
28 <
29 < {$mode objfpc}{$H+}
30 <
31 < interface
32 <
33 < uses
34 <  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
35 <  ComCtrls, StdCtrls, ExtCtrls, IBSystemTables, IBCustomDataSet, IBDatabase;
36 <
37 < type
38 <
39 <  { TIBDataSetEditorForm }
40 <
41 <  TIBDataSetEditorForm = class(TForm)
42 <    TestBtn: TButton;
43 <    CancelButton: TButton;
44 <    FieldsPage: TTabSheet;
45 <    GenerateButton: TButton;
46 <    GroupBox1: TGroupBox;
47 <    IBTransaction1: TIBTransaction;
48 <    IncludePrimaryKeys: TCheckBox;
49 <    PrimaryKeyList: TListBox;
50 <    Label1: TLabel;
51 <    Label2: TLabel;
52 <    Label3: TLabel;
53 <    Label4: TLabel;
54 <    OkButton: TButton;
55 <    PageControl: TPageControl;
56 <    QuoteFields: TCheckBox;
57 <    SQLMemo: TMemo;
58 <    SQLPage: TTabSheet;
59 <    StatementType: TRadioGroup;
60 <    FieldList: TListBox;
61 <    TableNamesCombo: TComboBox;
62 <    procedure TestBtnClick(Sender: TObject);
63 <    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
64 <    procedure FormShow(Sender: TObject);
65 <    procedure GenerateButtonClick(Sender: TObject);
66 <    procedure SQLMemoChange(Sender: TObject);
67 <    procedure SQLPageShow(Sender: TObject);
68 <    procedure StatementTypeClick(Sender: TObject);
69 <    procedure TableNamesComboCloseUp(Sender: TObject);
70 <  private
71 <    { private declarations }
72 <    FDataSet: TIBDataSet;
73 <    FIBSystemTables: TIBSystemTables;
74 <    FDirty: boolean;
75 <    FCurrentStatement: integer;
76 <    FSelectSQL: TStringList;
77 <    FModifySQL: TStringList;
78 <    FInsertSQL: TStringList;
79 <    FDeleteSQL: TStringList;
80 <    FRefreshSQL: TStringList;
81 <    procedure UpdateSQLMemo;
82 <  public
83 <    { public declarations }
84 <    constructor Create(TheOwner: TComponent); override;
85 <    destructor Destroy; override;
86 <    procedure SetDataSet(AObject: TIBDataSet);
87 <  end;
88 <
89 < var
90 <  IBDataSetEditorForm: TIBDataSetEditorForm;
91 <
92 < function EditIBDataSet(DataSet: TIBDataSet): boolean;
93 <
94 < implementation
95 <
96 < {$R *.lfm}
97 <
98 < function EditIBDataSet(DataSet: TIBDataSet): boolean;
99 < begin
100 <  Result := false;
101 <  if assigned(DataSet) and assigned(DataSet.Database) then
102 <  try
103 <    DataSet.Database.Connected := true;
104 <  except on E: Exception do
105 <    ShowMessage(E.Message)
106 <  end;
107 <
108 <  with TIBDataSetEditorForm.Create(Application) do
109 <  try
110 <    SetDataSet(DataSet);
111 <    Result := ShowModal = mrOK
112 <  finally
113 <    Free
114 <  end;
115 <
116 < end;
117 <
118 < { TIBDataSetEditorForm }
119 <
120 < procedure TIBDataSetEditorForm.FormShow(Sender: TObject);
121 < var TableName: string;
122 < begin
123 <  PageControl.ActivePage := FieldsPage;
124 <  FModifySQL.Assign(FDataSet.ModifySQL);
125 <  FInsertSQL.Assign(FDataSet.InsertSQL);
126 <  FDeleteSQL.Assign(FDataSet.DeleteSQL);
127 <  FRefreshSQL.Assign(FDataSet.RefreshSQL);
128 <  FSelectSQL.Assign(FDataSet.SelectSQL);
129 <  GenerateButton.Enabled := (IBTransaction1.DefaultDatabase <> nil) and IBTransaction1.DefaultDatabase.Connected;
130 <  TestBtn.Enabled := (IBTransaction1.DefaultDatabase <> nil) and IBTransaction1.DefaultDatabase.Connected;
131 <  FCurrentStatement := -1;
132 <  TableNamesCombo.Items.Clear;
133 <  FIBSystemTables.GetTableNames(TableNamesCombo.Items);
134 <  if TableNamesCombo.Items.Count > 0 then
135 <  begin
136 <    TableNamesCombo.ItemIndex := 0;
137 <    if FSelectSQL.Text <> '' then
138 <    try
139 <       FIBSystemTables.GetTableAndColumns(FSelectSQL.Text,TableName,nil);
140 <       TableNamesCombo.ItemIndex := TableNamesCombo.Items.IndexOf(TableName);
141 <    except end;//ignore
142 <    FIBSystemTables.GetFieldNames(TableNamesCombo.Text,FieldList.Items,IncludePrimaryKeys.checked,false);
143 <    FIBSystemTables.GetPrimaryKeys(TableNamesCombo.Text,PrimaryKeyList.Items);
144 <  end;
145 < end;
146 <
147 < procedure TIBDataSetEditorForm.FormClose(Sender: TObject;
148 <  var CloseAction: TCloseAction);
149 < begin
150 <  if ModalResult = mrOK then
151 <  begin
152 <    UpdateSQLMemo;
153 <    FDataSet.ModifySQL.Assign(FModifySQL);
154 <    FDataSet.InsertSQL.Assign(FInsertSQL);
155 <    FDataSet.DeleteSQL.Assign(FDeleteSQL);
156 <    FDataSet.RefreshSQL.Assign(FRefreshSQL);
157 <    FDataSet.SelectSQL.Assign(FSelectSQL);
158 <  end;
159 < end;
160 <
161 < procedure TIBDataSetEditorForm.TestBtnClick(Sender: TObject);
162 < begin
163 <  if SQLMemo.Lines.Text <> '' then
164 <    FIBSystemTables.TestSQL(SQLMemo.Lines.Text);
165 < end;
166 <
167 < procedure TIBDataSetEditorForm.GenerateButtonClick(Sender: TObject);
168 < var FieldNames: TStringList;
169 <    I: integer;
170 < begin
171 <  FieldNames := TStringList.Create;
172 <  try
173 <    FRefreshSQL.Clear;
174 <    FSelectSQL.Clear;
175 <    FIBSystemTables.GetFieldNames(TableNamesCombo.Text,FieldNames);
176 <    FIBSystemTables.GenerateSelectSQL(TableNamesCombo.Text,QuoteFields.Checked,FieldNames,FSelectSQL);
177 <    FIBSystemTables.GenerateRefreshSQL(TableNamesCombo.Text,QuoteFields.Checked,FieldNames,FRefreshSQL);
178 <    FIBSystemTables.GenerateDeleteSQL(TableNamesCombo.Text,QuoteFields.Checked,FDeleteSQL);
179 <    FieldNames.Clear;
180 <    FIBSystemTables.GetFieldNames(TableNamesCombo.Text,FieldNames,true,false);
181 <    FIBSystemTables.GenerateInsertSQL(TableNamesCombo.Text,QuoteFields.Checked,
182 <        FieldNames,FInsertSQL);
183 <    if FieldList.SelCount = 0 then
184 <    begin
185 <      FIBSystemTables.GenerateModifySQL(TableNamesCombo.Text,QuoteFields.Checked,
186 <        FieldList.Items,FModifySQL);
187 <
188 <    end
189 <    else
190 <    begin
191 <      FieldNames.Clear;
192 <      for I := 0 to FieldList.Items.Count - 1 do
193 <        if FieldList.Selected[I] then
194 <          FieldNames.Add(FieldList.Items[I]);
195 <      FIBSystemTables.GenerateModifySQL(TableNamesCombo.Text,QuoteFields.Checked,
196 <        FieldNames,FModifySQL);
197 <    end;
198 <    FDirty := false;
199 <    PageControl.ActivePage := SQLPage;
200 <  finally
201 <    FieldNames.Free
202 <  end;
203 < end;
204 <
205 < procedure TIBDataSetEditorForm.SQLMemoChange(Sender: TObject);
206 < begin
207 <  FDirty := true
208 < end;
209 <
210 < procedure TIBDataSetEditorForm.SQLPageShow(Sender: TObject);
211 < begin
212 <  UpdateSQLMemo
213 < end;
214 <
215 < procedure TIBDataSetEditorForm.StatementTypeClick(Sender: TObject);
216 < begin
217 <  UpdateSQLMemo
218 < end;
219 <
220 < procedure TIBDataSetEditorForm.TableNamesComboCloseUp(Sender: TObject);
221 < begin
222 <  FIBSystemTables.GetFieldNames(TableNamesCombo.Text,FieldList.Items,IncludePrimaryKeys.checked,false);
223 <  FIBSystemTables.GetPrimaryKeys(TableNamesCombo.Text,PrimaryKeyList.Items);
224 < end;
225 <
226 < procedure TIBDataSetEditorForm.UpdateSQLMemo;
227 < begin
228 <  if FDirty then
229 <    case FCurrentStatement of
230 <    0: // Select
231 <        FSelectSQL.Assign(SQLMemo.Lines);
232 <    1: //Modify
233 <        FModifySQL.Assign(SQLMemo.Lines);
234 <    2: //Insert
235 <        FInsertSQL.Assign(SQLMemo.Lines);
236 <    3: // Delete
237 <        FDeleteSQL.Assign(SQLMemo.Lines);
238 <    4: //Refresh
239 <        FRefreshSQL.Assign(SQLMemo.Lines);
240 <    end;
241 <  FDirty := false;
242 <  case StatementType.ItemIndex of
243 <  0: //Select
244 <     SQLMemo.Lines.Assign(FSelectSQL);
245 <  1: // Modify
246 <    SQLMemo.Lines.Assign(FModifySQL)  ;
247 <  2: //Insert
248 <    SQLMemo.Lines.Assign(FInsertSQL)  ;
249 <  3: // Delete
250 <    SQLMemo.Lines.Assign(FDeleteSQL)  ;
251 <  4: //Refresh
252 <    SQLMemo.Lines.Assign(FRefreshSQL)  ;
253 <  end;
254 <  FCurrentStatement := StatementType.ItemIndex;
255 < end;
256 <
257 < constructor TIBDataSetEditorForm.Create(TheOwner: TComponent);
258 < begin
259 <  inherited Create(TheOwner);
260 <  FIBSystemTables := TIBSystemTables.Create;
261 <  FModifySQL := TStringList.Create;
262 <  FInsertSQL := TStringList.Create;
263 <  FDeleteSQL := TStringList.Create;
264 <  FRefreshSQL := TStringList.Create;
265 <  FSelectSQL := TStringList.Create;
266 < end;
267 <
268 < destructor TIBDataSetEditorForm.Destroy;
269 < begin
270 <  if assigned(FIBSystemTables) then FIBSystemTables.Free;
271 <  if assigned(FModifySQL) then FModifySQL.Free;
272 <  if assigned(FInsertSQL) then FInsertSQL.Free;
273 <  if assigned(FDeleteSQL) then FDeleteSQL.Free;
274 <  if assigned(FRefreshSQL) then FRefreshSQL.Free;
275 < if assigned(FSelectSQL) then FSelectSQL.Free;
276 <  inherited Destroy;
277 < end;
278 <
279 < procedure TIBDataSetEditorForm.SetDataSet(AObject: TIBDataSet);
280 < begin
281 <  FDataSet := AObject;
282 <  IBTransaction1.DefaultDatabase := FDataSet.Database;
283 <  if assigned(FDataSet) then
284 <    FIBSystemTables.SelectDatabase(FDataSet.Database,IBTransaction1);
285 < end;
286 <
287 < end.
288 <
1 > (*
2 > *  IBX For Lazarus (Firebird Express)
3 > *
4 > *  The contents of this file are subject to the Initial Developer's
5 > *  Public License Version 1.0 (the "License"); you may not use this
6 > *  file except in compliance with the License. You may obtain a copy
7 > *  of the License here:
8 > *
9 > *    http://www.firebirdsql.org/index.php?op=doc&id=idpl
10 > *
11 > *  Software distributed under the License is distributed on an "AS
12 > *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13 > *  implied. See the License for the specific language governing rights
14 > *  and limitations under the License.
15 > *
16 > *  The Initial Developer of the Original Code is Tony Whyman.
17 > *
18 > *  The Original Code is (C) 2011 Tony Whyman, MWA Software
19 > *  (http://www.mwasoftware.co.uk).
20 > *
21 > *  All Rights Reserved.
22 > *
23 > *  Contributor(s): ______________________________________.
24 > *
25 > *)
26 >
27 > unit IBDataSetEditor;
28 >
29 > {$mode objfpc}{$H+}
30 >
31 > interface
32 >
33 > uses
34 >  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
35 >  StdCtrls, ExtCtrls, IBSQLEditFrame, IBCustomDataSet,
36 >  IBDatabase, IBLookupComboEditBox, IBDynamicGrid, Types;
37 >
38 > type
39 >
40 >  { TIBDataSetEditorForm }
41 >
42 >  TIBDataSetEditorForm = class(TForm)
43 >    FieldNamesGrid: TIBDynamicGrid;
44 >    GenerateParams: TCheckBox;
45 >    IBSQLEditFrame1: TIBSQLEditFrame;
46 >    IncludeSysTables: TCheckBox;
47 >    PrimaryKeysGrid: TIBDynamicGrid;
48 >    SelectSelectAll: TCheckBox;
49 >    SelectTableNames: TIBLookupComboEditBox;
50 >    TestBtn: TButton;
51 >    CancelButton: TButton;
52 >    FieldsPage: TTabSheet;
53 >    GenerateButton: TButton;
54 >    GroupBox1: TGroupBox;
55 >    IncludePrimaryKeys: TCheckBox;
56 >    Label1: TLabel;
57 >    Label2: TLabel;
58 >    Label3: TLabel;
59 >    Label4: TLabel;
60 >    OkButton: TButton;
61 >    PageControl: TPageControl;
62 >    QuoteFields: TCheckBox;
63 >    SQLPage: TTabSheet;
64 >    StatementType: TRadioGroup;
65 >    procedure IncludeSysTablesChange(Sender: TObject);
66 >    procedure SelectSelectAllClick(Sender: TObject);
67 >    procedure TestBtnClick(Sender: TObject);
68 >    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
69 >    procedure FormShow(Sender: TObject);
70 >    procedure GenerateButtonClick(Sender: TObject);
71 >    procedure SQLMemoChange(Sender: TObject);
72 >    procedure SQLPageShow(Sender: TObject);
73 >    procedure StatementTypeClick(Sender: TObject);
74 >  private
75 >    { private declarations }
76 >    FDataSet: TIBDataSet;
77 >    FDirty: boolean;
78 >    FCurrentStatement: integer;
79 >    FSelectSQL: TStringList;
80 >    FModifySQL: TStringList;
81 >    FInsertSQL: TStringList;
82 >    FDeleteSQL: TStringList;
83 >    FRefreshSQL: TStringList;
84 >    procedure UpdateSQLMemo;
85 >    procedure HandleUserTablesOpened(Sender: TObject);
86 >  protected
87 >    procedure Loaded; override;
88 >  public
89 >    { public declarations }
90 >    constructor Create(TheOwner: TComponent); override;
91 >    destructor Destroy; override;
92 >  end;
93 >
94 > var
95 >  IBDataSetEditorForm: TIBDataSetEditorForm;
96 >
97 > function EditIBDataSet(DataSet: TIBDataSet): boolean;
98 >
99 > implementation
100 >
101 > {$R *.lfm}
102 >
103 > function EditIBDataSet(DataSet: TIBDataSet): boolean;
104 > begin
105 >  Result := false;
106 >  if assigned(DataSet) and assigned(DataSet.Database) then
107 >  try
108 >    DataSet.Database.Connected := true;
109 >  except on E: Exception do
110 >    ShowMessage(E.Message)
111 >  end;
112 >
113 >  with TIBDataSetEditorForm.Create(Application) do
114 >  try
115 >    if assigned(DataSet) then
116 >    begin
117 >      IBSQLEditFrame1.Database := DataSet.Database;
118 >      GenerateParams.Checked := DataSet.GenerateParamNames;
119 >    end;
120 >    FDataSet := DataSet;
121 >    Result := ShowModal = mrOK;
122 >    if Result and assigned(DataSet) then
123 >      DataSet.GenerateParamNames := GenerateParams.Checked
124 >  finally
125 >    Free
126 >  end;
127 >
128 > end;
129 >
130 > { TIBDataSetEditorForm }
131 >
132 > procedure TIBDataSetEditorForm.FormShow(Sender: TObject);
133 > var TableName: string;
134 > begin
135 >  PageControl.ActivePage := FieldsPage;
136 >  FModifySQL.Assign(FDataSet.ModifySQL);
137 >  FInsertSQL.Assign(FDataSet.InsertSQL);
138 >  FDeleteSQL.Assign(FDataSet.DeleteSQL);
139 >  FRefreshSQL.Assign(FDataSet.RefreshSQL);
140 >  FSelectSQL.Assign(FDataSet.SelectSQL);
141 >  GenerateButton.Enabled := (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected;
142 >  TestBtn.Enabled := (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected;
143 >  FCurrentStatement := -1;
144 >  if (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected then
145 >  begin
146 >    IBSQLEditFrame1.UserTables.Active := true;
147 >    IBSQLEditFrame1.SyncQueryBuilder(FSelectSQL);
148 >  end;
149 > end;
150 >
151 > procedure TIBDataSetEditorForm.FormClose(Sender: TObject;
152 >  var CloseAction: TCloseAction);
153 > begin
154 >  if ModalResult = mrOK then
155 >  begin
156 >    UpdateSQLMemo;
157 >    FDataSet.ModifySQL.Assign(FModifySQL);
158 >    FDataSet.InsertSQL.Assign(FInsertSQL);
159 >    FDataSet.DeleteSQL.Assign(FDeleteSQL);
160 >    FDataSet.RefreshSQL.Assign(FRefreshSQL);
161 >    FDataSet.SelectSQL.Assign(FSelectSQL);
162 >  end;
163 > end;
164 >
165 > procedure TIBDataSetEditorForm.TestBtnClick(Sender: TObject);
166 > begin
167 >  IBSQLEditFrame1.TestSQL(GenerateParams.Checked);
168 > end;
169 >
170 > procedure TIBDataSetEditorForm.IncludeSysTablesChange(Sender: TObject);
171 > begin
172 >  IBSQLEditFrame1.IncludeSystemTables := IncludeSysTables.Checked;
173 > end;
174 >
175 > procedure TIBDataSetEditorForm.SelectSelectAllClick(Sender: TObject);
176 > begin
177 >  IBSQLEditFrame1.SelectAllFields(SelectSelectAll.Checked);
178 > end;
179 >
180 > procedure TIBDataSetEditorForm.GenerateButtonClick(Sender: TObject);
181 > begin
182 >  IBSQLEditFrame1.GenerateSelectSQL(QuoteFields.Checked,FSelectSQL);
183 >  IBSQLEditFrame1.GenerateRefreshSQL(QuoteFields.Checked,FRefreshSQL);
184 >  IBSQLEditFrame1.GenerateDeleteSQL(QuoteFields.Checked,FDeleteSQL);
185 >  IBSQLEditFrame1.GenerateInsertSQL(QuoteFields.Checked,FInsertSQL);
186 >  IBSQLEditFrame1.GenerateModifySQL(QuoteFields.Checked,FModifySQL, not IncludePrimaryKeys.Checked);
187 >  FDirty := false;
188 >  PageControl.ActivePage := SQLPage;
189 > end;
190 >
191 > procedure TIBDataSetEditorForm.SQLMemoChange(Sender: TObject);
192 > begin
193 >  FDirty := true
194 > end;
195 >
196 > procedure TIBDataSetEditorForm.SQLPageShow(Sender: TObject);
197 > begin
198 >  UpdateSQLMemo
199 > end;
200 >
201 > procedure TIBDataSetEditorForm.StatementTypeClick(Sender: TObject);
202 > begin
203 >  UpdateSQLMemo
204 > end;
205 >
206 > procedure TIBDataSetEditorForm.UpdateSQLMemo;
207 > begin
208 >  if FDirty then
209 >    case FCurrentStatement of
210 >    0: // Select
211 >        FSelectSQL.Assign(IBSQLEditFrame1.SQLText.Lines);
212 >    1: //Modify
213 >        FModifySQL.Assign(IBSQLEditFrame1.SQLText.Lines);
214 >    2: //Insert
215 >        FInsertSQL.Assign(IBSQLEditFrame1.SQLText.Lines);
216 >    3: // Delete
217 >        FDeleteSQL.Assign(IBSQLEditFrame1.SQLText.Lines);
218 >    4: //Refresh
219 >        FRefreshSQL.Assign(IBSQLEditFrame1.SQLText.Lines);
220 >    end;
221 >  FDirty := false;
222 >  case StatementType.ItemIndex of
223 >  0: //Select
224 >     IBSQLEditFrame1.SQLText.Lines.Assign(FSelectSQL);
225 >  1: // Modify
226 >    IBSQLEditFrame1.SQLText.Lines.Assign(FModifySQL)  ;
227 >  2: //Insert
228 >    IBSQLEditFrame1.SQLText.Lines.Assign(FInsertSQL)  ;
229 >  3: // Delete
230 >    IBSQLEditFrame1.SQLText.Lines.Assign(FDeleteSQL)  ;
231 >  4: //Refresh
232 >    IBSQLEditFrame1.SQLText.Lines.Assign(FRefreshSQL)  ;
233 >  end;
234 >  FCurrentStatement := StatementType.ItemIndex;
235 > end;
236 >
237 > procedure TIBDataSetEditorForm.HandleUserTablesOpened(Sender: TObject);
238 > begin
239 >  SelectSelectAll.Checked := true;
240 > end;
241 >
242 > procedure TIBDataSetEditorForm.Loaded;
243 > begin
244 >  inherited Loaded;
245 >  if IBSQLEditFrame1 <> nil then
246 >  begin
247 >    IBSQLEditFrame1.OnUserTablesOpened := @HandleUserTablesOpened;
248 >    if SelectTableNames <> nil then
249 >      SelectTableNames.ListSource :=  IBSQLEditFrame1.UserTableSource;
250 >    if FieldNamesGrid <> nil then
251 >      FieldNamesGrid.DataSource := IBSQLEditFrame1.FieldsSource;
252 >    if PrimaryKeysGrid <> nil then
253 >      PrimaryKeysGrid.DataSource := IBSQLEditFrame1.PrimaryKeySource;
254 >  end;
255 > end;
256 >
257 > constructor TIBDataSetEditorForm.Create(TheOwner: TComponent);
258 > begin
259 >  inherited Create(TheOwner);
260 >  FModifySQL := TStringList.Create;
261 >  FInsertSQL := TStringList.Create;
262 >  FDeleteSQL := TStringList.Create;
263 >  FRefreshSQL := TStringList.Create;
264 >  FSelectSQL := TStringList.Create;
265 > end;
266 >
267 > destructor TIBDataSetEditorForm.Destroy;
268 > begin
269 >  if assigned(FModifySQL) then FModifySQL.Free;
270 >  if assigned(FInsertSQL) then FInsertSQL.Free;
271 >  if assigned(FDeleteSQL) then FDeleteSQL.Free;
272 >  if assigned(FRefreshSQL) then FRefreshSQL.Free;
273 >  if assigned(FSelectSQL) then FSelectSQL.Free;
274 >  inherited Destroy;
275 > end;
276 >
277 > end.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines