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 314 by tony, Fri Apr 17 10:26:08 2020 UTC vs.
Revision 315 by tony, Thu Feb 25 11:56:36 2021 UTC

# Line 31 | Line 31 | type
31    { TDBDataModule }
32  
33    TDBDataModule = class(TDataModule)
34 <    AccessRightsCHILDCOUNT: TIBLargeIntField;
34 >    AccessRightsCHILDCOUNT: TIBIntegerField;
35      AccessRightsDisplayName: TStringField;
36      AccessRightsID: TIBStringField;
37      AccessRightsImageIndex: TLongintField;
# Line 449 | Line 449 | begin
449    DataSet.FieldByName('SEC$ACTIVE').AsBoolean := false;
450    DataSet.FieldByName('DBCreator').AsBoolean := false;
451    DataSet.FieldByName('SEC$PLUGIN').AsString := 'Srp';
452 <  DataSet.FieldByName('UserID').AsInteger := 0;
453 <  DataSet.FieldByName('GroupID').AsInteger := 0;
452 > //  DataSet.FieldByName('UserID').AsInteger := 0;
453 > //  DataSet.FieldByName('GroupID').AsInteger := 0;
454    DataSet.FieldByName('SEC$PASSWORD').Clear;
455    RoleNameList.Active := false; {Prevent role assignments until saved}
456    UserTags.Active := false; {ditto}
# Line 458 | Line 458 | end;
458  
459   procedure TDBDataModule.UserListAfterOpen(DataSet: TDataSet);
460   begin
461 <  UserListSource.DataSet := UserList;
461 >  if UserListSource.DataSet <> DataSet then
462 >    UserListSource.DataSet := DataSet;
463    RoleNameList.Active := true;
464    UserTags.Active := true;
465   end;
# Line 1059 | Line 1060 | begin
1060   end;
1061  
1062   procedure TDBDataModule.ActivateShadow;
1063 + var DBConnected: boolean;
1064   begin
1065 <  IBConfigService1.ActivateShadow;
1065 >  DBConnected := IBDatabase1.Connected;
1066 >  IBDatabase1.Connected := false;
1067 >  try
1068 >    IBConfigService1.ActivateShadow;
1069 >  finally
1070 >    IBDatabase1.Connected := DBConnected;
1071 >  end;
1072    MessageDlg('Shadow Database activated. You should now rename the file or change the database alias name to point to the shadow',
1073      mtInformation,[mbOK],0);
1074   end;
# Line 1380 | Line 1388 | end;
1388  
1389   procedure TDBDataModule.LegacyUserListAfterOpen(DataSet: TDataSet);
1390   begin
1391 <  UserListSource.DataSet := LegacyUserList;
1391 >  if UserListSource.DataSet <> LegacyUserList then
1392 >    UserListSource.DataSet := LegacyUserList;
1393    if IBDatabase1.Connected then
1394    begin
1395      CurrentTransaction.Active := true;
# Line 1496 | Line 1505 | end;
1505  
1506   procedure TDBDataModule.IBDatabase1BeforeDisconnect(Sender: TObject);
1507   begin
1508 +  FDBHeaderScanned := false;
1509    FDisconnecting := true;
1510   end;
1511  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines