user534498
user534498

Reputation: 3984

Delphi and Interbase: username and password not defined?

I recently encountered a legacy code (Delphi 2007). There is a SYSTEM.IB file while I believe it's the database file.

The program is roughly as follows:

ibSys: TIBDatabase;

// The following will throw exception username and password are not defined.
// Ask your database admin to set up an InterBase login
procedure TNHP_CommonDB.IB_SystemOpen(Apath: string):
begin
  ibSys.DatabaseName := Apath + '\SYSTEM.IB';
  try
    ibSys.Open;
  except
    raise;
  end;
end;

I think the default username is sysdba, and default password is masterkey. I installed Interbase without changing the default password.

So How should I deal with this exception?

Thanks.

Upvotes: 0

Views: 2750

Answers (1)

Johan
Johan

Reputation: 76567

It is clearly documented in the docwiki for TIBDatabase:

The user_name and password are set in the params property.

    IBDatabaseInstance.Params.Clear; // Clear any previously-set parameter.
    IBDatabaseInstance.Params.Add('user_name=SYSDBA');
    IBDatabaseInstance.Params.Add('password=masterkey');

Upvotes: 3

Related Questions