Page 1 of 1
Set / change DB user Password with Delphi 2010 on FB 2.5
Posted: Tue 25 Oct 2011 08:24
by werkstattboss
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
Posted: Tue 25 Oct 2011 13:59
by AndreyZ
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.