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

Comparing ibx/trunk/examples/DBAdmin/DataModule.pas (file contents):
Revision 272 by tony, Mon Feb 4 13:34:37 2019 UTC vs.
Revision 273 by tony, Mon Feb 4 13:36:50 2019 UTC

# Line 75 | Line 75 | type
75      CurrentTransaction: TIBTransaction;
76      DatabaseQuery: TIBQuery;
77      Attachments: TIBQuery;
78    DatabaseQueryMONBACKUP_STATE: TIBSmallintField;
79    DatabaseQueryMONCREATION_DATE: TDateTimeField;
80    DatabaseQueryMONCRYPT_PAGE: TIBLargeIntField;
81    DatabaseQueryMONDATABASE_NAME: TIBStringField;
82    DatabaseQueryMONFORCED_WRITES: TIBSmallintField;
83    DatabaseQueryMONNEXT_TRANSACTION: TIBLargeIntField;
84    DatabaseQueryMONODS_MAJOR: TIBSmallintField;
85    DatabaseQueryMONODS_MINOR: TIBSmallintField;
86    DatabaseQueryMONOLDEST_ACTIVE: TIBLargeIntField;
87    DatabaseQueryMONOLDEST_SNAPSHOT: TIBLargeIntField;
88    DatabaseQueryMONOLDEST_TRANSACTION: TIBLargeIntField;
89    DatabaseQueryMONOWNER: TIBStringField;
90    DatabaseQueryMONPAGES: TIBLargeIntField;
91    DatabaseQueryMONPAGE_BUFFERS: TIBIntegerField;
92    DatabaseQueryMONPAGE_SIZE: TIBSmallintField;
93    DatabaseQueryMONREAD_ONLY: TIBSmallintField;
94    DatabaseQueryMONRESERVE_SPACE: TIBSmallintField;
95    DatabaseQueryMONSEC_DATABASE: TIBStringField;
96    DatabaseQueryMONSHUTDOWN_MODE: TIBSmallintField;
97    DatabaseQueryMONSQL_DIALECT: TIBSmallintField;
98    DatabaseQueryMONSTAT_ID: TIBIntegerField;
99    DatabaseQueryMONSWEEP_INTERVAL: TIBIntegerField;
100    DatabaseQueryRDBCHARACTER_SET_NAME: TIBStringField;
101    DatabaseQueryRDBDESCRIPTION: TIBMemoField;
102    DatabaseQueryRDBLINGER: TIBIntegerField;
103    DatabaseQueryRDBRELATION_ID: TIBSmallintField;
104    DatabaseQueryRDBSECURITY_CLASS: TIBStringField;
78      DBTables: TIBQuery;
79      AuthMappings: TIBQuery;
80      AccessRights: TIBQuery;
# Line 167 | Line 140 | type
140      procedure CurrentTransactionAfterTransactionEnd(Sender: TObject);
141      procedure DatabaseQueryAfterOpen(DataSet: TDataSet);
142      procedure DatabaseQueryBeforeClose(DataSet: TDataSet);
170    procedure DatabaseQueryMONCREATION_DATEGetText(Sender: TField;
171      var aText: string; DisplayText: Boolean);
143      procedure DBCharSetAfterClose(DataSet: TDataSet);
144      procedure DBCharSetBeforeOpen(DataSet: TDataSet);
145      procedure IBDatabase1AfterConnect(Sender: TObject);
# Line 222 | Line 193 | type
193      function GetAuthMethod: string;
194      function GetAutoAdmin: boolean;
195      function GetDatabaseName: string;
196 +    function GetDBDateCreated: string;
197      procedure GetDBFlags;
198      function GetDBOwner: string;
199      function GetDBReadOnly: boolean;
# Line 295 | Line 267 | type
267      property RoleName: string read GetRoleName;
268      property DBOwner: string read GetDBOwner;
269      property DBSQLDialect: integer read GetDBSQLDialect write SetDBSQLDialect;
270 +    property DBDateCreated: string read GetDBDateCreated;
271      property ServerName: string read GetServerName;
272      property ServiceUserName: string read FServiceUserName;
273      property HasUserAdminPrivilege: boolean read FHasUserAdminPrivilege;
# Line 596 | Line 569 | begin
569      Result := FDatabasePathName;
570   end;
571  
572 + function TDBDataModule.GetDBDateCreated: string;
573 + begin
574 +  with DefaultFormatSettings do
575 +  try
576 +    Result := FormatDateTime(LongDateFormat + ' ' + LongTimeFormat,DatabaseQuery.FieldByName('MON$CREATION_DATE').AsDateTime);
577 +  except
578 +    Result := 'unknown';
579 +  end;
580 + end;
581 +
582   function TDBDataModule.GetDBReadOnly: boolean;
583   begin
584    Result := DatabaseQuery.Active and (DatabaseQuery.FieldByName('MON$READ_ONLY').AsInteger  <> 0);
# Line 1589 | Line 1572 | begin
1572    DBCharSet.Active := false;
1573   end;
1574  
1592 procedure TDBDataModule.DatabaseQueryMONCREATION_DATEGetText(Sender: TField;
1593  var aText: string; DisplayText: Boolean);
1594 begin
1595  if DisplayText then
1596    with DefaultFormatSettings do
1597      aText := FormatDateTime(LongDateFormat + ' ' + LongTimeFormat,Sender.AsDateTime)
1598  else
1599      aText := Sender.AsString;
1600 end;
1601
1575   procedure TDBDataModule.DBCharSetAfterClose(DataSet: TDataSet);
1576   begin
1577    CharSetLookup.Active := false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines