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 |
|
|
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 |
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; |
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 |