Subject Re: Multithread aplication with embedded server
Author carlos_ochotorena
The error I am getting is "Cannot attach to services manager"
It only happens when I am running my app as a service. When it is
running as a standard application it works properly.

The code I am using is:

BackupService := TIBBackupService.Create(nil);

try
with BackupService do
begin
ServerName := ConnectionData.ServerName;
LoginPrompt := False;
Params.Add(Format('user_name=%s',[ConnectionData.UserName]));
Params.Add(Format('password=%s',[ConnectionData.Password]));
Active := True;
try
Verbose := False;
Options := [NonTransportable, IgnoreLimbo];
DatabaseName := ConnectionData.DatabaseName;
BackupFile.Add(BackupFileName);

ServiceStart;
while not eof do
sleep(500);
finally
Active := False;
end;
end;
finally
BackupService.Free;
end;


And the error is raised when the "Active := True" line is executed.
The application is connected as SYSDBA to the database and all the
other tasks work properly

--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...>
wrote:
>
> > OK. I am using the TIBBackupService component and now I can
perform
> > the backup while the application is running as a standard
> > application.
> >
> > But I still cannot backup the database when the application is
> > running as a Windows Service. Any clue? Can it be done?
> >
> > (The application we are developing needs to run as both
application
> > and service using the embedded server as well as the standard
client
> > and server architecture)
> >
> > Thanks in advance
>
> yes, of course it is...
> The only thing you need to remember is that you need to be SYSDBA
or the
> OWNER fo the database to backup it up.
> What is the error you are getting?
> Alan
>