Subject Service Manager on FB 2.0 and higher
Author Thomas Bachinger

I am using the FB service manager to perform a database backup/restore cycle from within my application. The process has worked perfectly under 1.0 and 1.5 installs of FB. Now when I moved to FB 2.0.4 I get the error message "Target shutdown mode is invalid for database "XXXX"".

I tried FB 2.0.3 and FB 2.1.1 and get the same result. My application is developed on Delphi 2007 using the IBX components. The OS is XP with SP3 and the FB 2.0.4 server version is installed. The code does essentially the following:

1) Database.Connected := False;

2) IBConfigService.ShutdownDatabase(Forced, FTime);

3) IBRestoreService.Options := [Replace, NoShadow, NoValidityCheck];

4) IBRestoreService.ServiceStart;

5) IBConfigService.BringDatabaseOnline;

6) Database.Connected := True;

It is during step 5 that the above error message appears in all FB 2 versions. Disconnection, shutdown and restoring steps still work perfectly. If I trap the exception the code even goes on and I can connect to the database in step 6 without a problem.

Many thanks in advance for your help.


[Non-text portions of this message have been removed]