Subject | Re: Multithread aplication with embedded server |
---|---|
Author | carlos_ochotorena |
Post date | 2006-06-27T07:35:11Z |
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:
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:
>perform
> > OK. I am using the TIBBackupService component and now I can
> > the backup while the application is running as a standardapplication
> > 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
> > and service using the embedded server as well as the standardclient
> > and server architecture)or the
> >
> > Thanks in advance
>
> yes, of course it is...
> The only thing you need to remember is that you need to be SYSDBA
> OWNER fo the database to backup it up.
> What is the error you are getting?
> Alan
>