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

Comparing ibx/trunk/design/ibdeletesqleditor.pas (file contents):
Revision 17 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      Label1: TLabel;
# Line 69 | Line 70 | type
70   var
71    IBDeleteSQLEditorForm: TIBDeleteSQLEditorForm;
72  
73 < function EditSQL(Database: TIBDatabase; SelectSQL: TStrings): boolean;
73 > function EditSQL(DataSet: TIBCustomDataSet; SelectSQL: TStrings): boolean;
74  
75   implementation
76  
77   {$R *.lfm}
78  
79 < function EditSQL(Database: TIBDatabase; SelectSQL: TStrings): boolean;
79 > function EditSQL(DataSet: TIBCustomDataSet; SelectSQL: TStrings): boolean;
80   begin
81    Result := false;
82 <  if assigned(Database) then
82 >  if assigned(DataSet) and assigned(DataSet.Database) then
83      try
84 <      Database.Connected := true;
84 >      DataSet.Database.Connected := true;
85      except on E: Exception do
86        ShowMessage(E.Message)
87      end;
88  
89    with TIBDeleteSQLEditorForm.Create(Application) do
90    try
91 <    SetDatabase(Database);
91 >    if assigned(DataSet) then
92 >    begin
93 >        SetDatabase(DataSet.Database);
94 >        GenerateParams.Checked := DataSet.GenerateParamNames;
95 >    end;
96      SQLText.Lines.Assign(SelectSQL);
97      Result := ShowModal = mrOK;
98      if Result then
99 <     SelectSQL.Assign(SQLText.Lines)
99 >    begin
100 >     SelectSQL.Assign(SQLText.Lines);
101 >     if assigned(DataSet) then
102 >          DataSet.GenerateParamNames := GenerateParams.Checked
103 >    end;
104    finally
105      Free
106    end;
# Line 133 | Line 142 | end;
142  
143   procedure TIBDeleteSQLEditorForm.TestBtnClick(Sender: TObject);
144   begin
145 <  FIBSystemTables.TestSQL(SQLText.Lines.Text)
145 >  FIBSystemTables.TestSQL(SQLText.Lines.Text,GenerateParams.Checked)
146   end;
147  
148   procedure TIBDeleteSQLEditorForm.TableNamesComboCloseUp(Sender: TObject);
# Line 160 | Line 169 | begin
169   end;
170  
171   end.
172 <
172 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines