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

Comparing ibx/trunk/design/ibgeneratoreditor.pas (file contents):
Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC vs.
Revision 107 by tony, Thu Jan 18 14:37:40 2018 UTC

# Line 33 | Line 33 | interface
33   uses
34    Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
35    StdCtrls, ComCtrls, db, IBDatabase, IBCustomDataSet, IBQuery, IBSQL,
36 <  IBLookupComboEditBox, IB;
36 >  IBLookupComboEditBox, IB, IBTable;
37  
38   type
39  
# Line 83 | Line 83 | function EditGenerator(AGenerator: TIBGe
83   var Database: TIBDatabase;
84   begin
85    Result := false;
86 <  if (AGenerator.Owner is TIBQuery and ((AGenerator.Owner as TIBQuery).SQL.Text = '')) or
87 <   (AGenerator.Owner is TIBDataSet and ((AGenerator.Owner as TIBDataSet).SelectSQL.Text = '')) then
86 >  if not (AGenerator.Owner is TIBTable) and
87 >   ((AGenerator.Owner is TIBQuery and ((AGenerator.Owner as TIBQuery).SQL.Text = '')) or
88 >   (AGenerator.Owner is TIBDataSet and ((AGenerator.Owner as TIBDataSet).SelectSQL.Text = ''))) then
89    begin
90      ShowMessage('No Select SQL Found!');
91      Exit
# Line 111 | Line 112 | end;
112  
113   procedure TGeneratorEditor.FormShow(Sender: TObject);
114   begin
115 +  if (PrimaryKeys.Database = nil) or not PrimaryKeys.Database.Connected then Exit;
116    SQLTransaction.Active := true;
117    PrimaryKeys.Active := true;
118    GeneratorQuery.Active := true;
# Line 137 | Line 139 | begin
139    with IdentifyStatementSQL do
140    begin
141      Transaction.Active := true;
142 +    if FGenerator.Owner is TIBTable then
143 +    begin
144 +      Result :=  TIBTable(FGenerator.Owner).TableName;
145 +      Exit;
146 +    end;
147      if FGenerator.Owner is TIBQuery then
148        SQL.Assign((FGenerator.Owner as TIBQuery).SQL)
149      else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines