Subject | RE: [firebird-support] Re: Multithread aplication with embedded server |
---|---|
Author | Alan McDonald |
Post date | 2006-06-27T07:45:51Z |
> The error I am getting is "Cannot attach to services manager"your app as a service?
> It only happens when I am running my app as a service. When it is
> running as a standard application it works properly.
you'd better tell us more about the architecture now....
you have a service application which uses the embedded server.. YES?
I suspect that your appplication running as a service will need to use the
TP stack ..
Alan
>
> 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
>