Problem: TIBCBackupService in a windows service on Windows 7

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
GPL
Posts: 8
Joined: Thu 12 May 2011 07:15

Problem: TIBCBackupService in a windows service on Windows 7

Post by GPL » Thu 08 Sep 2011 12:11

I wrote a little windows-service for creating a daily backup of a local Firebird database. I use the TIBCBackupService for it.
On XP or Vista it runs perfect, but under Windows 7 (64bit) I will get the error: "Your user name and passwort are not defined. Ask your database administrator to set up a Firebird login."

The username and passwort are set correct and if I make a backup with other tools (e.g. ibexpert) it works without a problem.

I think, the problem is the service. Does anyone know, if there are restrictions in windows 7 that make such problems?
I use TCP for the connection and I've disabled the firewall for testing.

Any ideas?

AndreyZ

Post by AndreyZ » Fri 09 Sep 2011 08:05

Hello,

I cannot reproduce the problem. I've tried to use the following code:

Code: Select all

procedure TIBDAC_Service.ServiceExecute(Sender: TService);
begin
  try
    IBCBackupService1.ClientLibrary := 'fbclient.dll';
    IBCBackupService1.Server := 'server';
    IBCBackupService1.Username := 'sysdba';
    IBCBackupService1.Password := 'masterkey';
    IBCBackupService1.Database := 'database';
    IBCBackupService1.LoginPrompt := False;
    IBCBackupService1.BackupFile.Text := 'filename';
    IBCBackupService1.Attach;
    IBCBackupService1.ServiceStart;
    while IBCBackupService1.IsServiceRunning do;
  finally
    IBCBackupService1.Detach;
  end;
end;
, and there were no problems. Please check if this code works for you. Also check that you are really using the correct user name and password.

GPL
Posts: 8
Joined: Thu 12 May 2011 07:15

Post by GPL » Fri 09 Sep 2011 13:08

Hi Andrey,

thank your for your answer.
I've used the params to set the username and password. That's the mistake.
After I set IBCBackupService1.Username and IBCBackupService1.Password and let the params empty, it works!

Thank you for your advice!

Post Reply