Set / change DB user Password with Delphi 2010 on FB 2.5

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
werkstattboss
Posts: 20
Joined: Fri 15 May 2009 17:53

Set / change DB user Password with Delphi 2010 on FB 2.5

Post by werkstattboss » Tue 25 Oct 2011 08:24

Hello,
how can I change the user password for a FB 2.5 Database with Delphi?

I don´t want to read it or decode it, just have the user set a personal password.

TIA
Rolf

AndreyZ

Post by AndreyZ » Tue 25 Oct 2011 13:59

Hello,

You can change user password using the TIBCSecurityService component. Here is an example:

Code: Select all

procedure TMainForm.BitBtnClick(Sender: TObject);
begin
  IBCSecurityService.ClientLibrary := 'fbclient.dll';
  IBCSecurityService.Username := 'SYSDBA';
  IBCSecurityService.Password := 'masterkey';
  IBCSecurityService.LoginPrompt := False;
  IBCSecurityService.Attach;
  IBCSecurityService.UserInfo.UserName := 'username';
  IBCSecurityService.UserInfo.Password := 'new password';
  IBCSecurityService.ModifyUser;
  IBCSecurityService.Detach;
end;
Note that to change user password, you should use the SYSDBA user.

Post Reply