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 228 by tony, Fri Mar 16 11:08:20 2018 UTC vs.
Revision 229 by tony, Tue Apr 10 13:32:36 2018 UTC

# Line 195 | Line 195 | type
195      function GetDBReadOnly: boolean;
196      function GetDBSQLDialect: integer;
197      function GetDBUserName: string;
198 +    function GetDescription: string;
199      function GetEmbeddedMode: boolean;
200      function GetForcedWrites: boolean;
201      function GetLingerDelay: string;
# Line 207 | Line 208 | type
208      procedure SetAutoAdmin(AValue: boolean);
209      procedure SetDBReadOnly(AValue: boolean);
210      procedure SetDBSQLDialect(AValue: integer);
211 +    procedure SetDescription(AValue: string);
212      procedure SetForcedWrites(AValue: boolean);
213      procedure SetLingerDelay(AValue: string);
214      procedure SetNoReserve(AValue: boolean);
# Line 238 | Line 240 | type
240      procedure RevokeAll;
241      procedure SyncSubjectAccessRights(ID: string);
242      property AutoAdmin: boolean read GetAutoAdmin write SetAutoAdmin;
243 +    property Description: string read GetDescription write SetDescription;
244      property Disconnecting: boolean read FDisconnecting;
245      property ForcedWrites: boolean read GetForcedWrites write SetForcedWrites;
246      property LingerDelay: string read GetLingerDelay write SetLingerDelay;
# Line 561 | Line 564 | begin
564    Result := Trim(AttmtQuery.FieldByName('MON$USER').AsString);
565   end;
566  
567 + function TDatabaseData.GetDescription: string;
568 + begin
569 +  Result :=  DatabaseQuery.FieldByName('RDB$DESCRIPTION').AsString;
570 + end;
571 +
572   function TDatabaseData.GetEmbeddedMode: boolean;
573   begin
574    Result := AttmtQuery.FieldByName('MON$REMOTE_PROTOCOL').IsNull;
# Line 965 | Line 973 | begin
973    end;
974   end;
975  
976 + procedure TDatabaseData.SetDescription(AValue: string);
977 + begin
978 +  with TIBSQL.Create(IBDatabase1) do
979 +  try
980 +    SQL.Text := 'Comment on Database is ''' + SQLSafeString(AValue) + '''';
981 +    Transaction.Active := true;
982 +    ExecQuery;
983 +  finally
984 +    Free;
985 +  end;
986 +  CurrentTransaction.Commit;
987 + end;
988 +
989   procedure TDatabaseData.SetForcedWrites(AValue: boolean);
990   begin
991    IBConfigService1.SetAsyncMode(not AValue);
# Line 1362 | Line 1383 | end;
1383   procedure TDatabaseData.CurrentTransactionAfterTransactionEnd(Sender: TObject);
1384   begin
1385    if not Disconnecting and not (csDestroying in ComponentState) then
1386 +  begin
1387 +    CurrentTransaction.Active := true;
1388      Application.QueueAsyncCall(@ReloadData,0);
1389 +  end;
1390   end;
1391  
1392   procedure TDatabaseData.ApplicationProperties1Exception(Sender: TObject;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines