Subject Re: Changing SYSDBA password from Delphi application
Author paulwesson
> >How to change SYSDBA password from Delphi application?
> >
> >I have IBX and FIBPlus components to connect to Firebird.

I just shell out and run the GSEC command. If flashes the DOS window,
but hey, it works.

sCmd := '-database ' + txtIP.Text + ':' + txtSecurityDB.Text + ' -user
sysdba -password ' + txtPassword.Text + ' -modify sysdba -pw ' +
txtPW1.Text;

// sToolsPath is the location of GSEC
ExecuteCommand('gsec', sCmd, sToolsPath);

procedure TForm1.ExecuteCommand(sCommand: String; sParameters: String;
sPath: String);
var
SEInfo: TShellExecuteInfo;
ExitCode: DWORD;
i: Integer;
begin
FillChar(SEInfo, SizeOf(SEInfo), 0);
SEInfo.cbSize := SizeOf(TShellExecuteInfo);
with SEInfo do begin
fMask := SEE_MASK_NOCLOSEPROCESS;
Wnd := Application.Handle;
lpFile := PChar(sCommand);
lpParameters := PChar(sParameters);
lpDirectory := PChar(sPath);
nShow := SW_SHOWNORMAL;
end;
if ShellExecuteEx(@SEInfo) then begin
repeat
Application.ProcessMessages;
GetExitCodeProcess(SEInfo.hProcess, ExitCode);
until (ExitCode <> STILL_ACTIVE) or
Application.Terminated;
end
else ShowMessage('Error!');

for i := 1 to 100 do
Application.ProcessMessages;
end;