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

Comparing ibx/trunk/design/ibmodifysqleditor.pas (file contents):
Revision 18 by tony, Sat Dec 28 19:22:24 2013 UTC vs.
Revision 19 by tony, Mon Jul 7 13:00:15 2014 UTC

# Line 32 | Line 32 | interface
32  
33   uses
34    Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
35 <  StdCtrls, IBSystemTables, IBDatabase;
35 >  StdCtrls, IBSystemTables, IBDatabase, IBCustomDataSet;
36  
37   type
38  
# Line 42 | Line 42 | type
42      Button1: TButton;
43      Button2: TButton;
44      GenerateBtn: TButton;
45 +    GenerateParams: TCheckBox;
46      TestBtn: TButton;
47      IBTransaction1: TIBTransaction;
48      IncludePrimaryKeys: TCheckBox;
# Line 73 | Line 74 | type
74   var
75    IBModifySQLEditorForm: TIBModifySQLEditorForm;
76  
77 < function EditSQL(Database: TIBDatabase;  SelectSQL: TStrings): boolean;
77 > function EditSQL(DataSet: TIBCustomDataSet;  SelectSQL: TStrings): boolean;
78  
79   implementation
80  
81   {$R *.lfm}
82  
83 < function EditSQL(Database: TIBDatabase; SelectSQL: TStrings): boolean;
83 > function EditSQL(DataSet: TIBCustomDataSet; SelectSQL: TStrings): boolean;
84   begin
85    Result := false;
86 <  if assigned(Database) then
86 >  if assigned(DataSet) and assigned(DataSet.Database) then
87      try
88 <      Database.Connected := true;
88 >      DataSet.Database.Connected := true;
89      except on E: Exception do
90        ShowMessage(E.Message)
91      end;
92  
93    with TIBModifySQLEditorForm.Create(Application) do
94    try
95 <    SetDatabase(Database);
95 >    if assigned(DataSet) then
96 >    begin
97 >      SetDatabase(DataSet.Database);
98 >      GenerateParams.Checked := DataSet.GenerateParamNames;
99 >    end;
100      SQLText.Lines.Assign(SelectSQL);
101      Result := ShowModal = mrOK;
102      if Result then
103 <     SelectSQL.Assign(SQLText.Lines)
103 >    begin
104 >     SelectSQL.Assign(SQLText.Lines);
105 >     if assigned(DataSet) then
106 >          DataSet.GenerateParamNames := GenerateParams.Checked
107 >    end;
108    finally
109      Free
110    end;
# Line 151 | Line 160 | end;
160  
161   procedure TIBModifySQLEditorForm.TestBtnClick(Sender: TObject);
162   begin
163 <  FIBSystemTables.TestSQL(SQLText.Lines.Text)
163 >  FIBSystemTables.TestSQL(SQLText.Lines.Text,GenerateParams.Checked)
164   end;
165  
166   procedure TIBModifySQLEditorForm.TableNamesComboCloseUp(Sender: TObject);
# Line 179 | Line 188 | begin
188   end;
189  
190   end.
191 <
191 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines