Subject | Re: [IBO] IBOAdmin documentation |
---|---|
Author | mspencewasunavailable |
Post date | 2006-12-05T22:06:11Z |
--- In IBObjects@yahoogroups.com, Toby Leonard <TobyL@...> wrote:
>application.
> mspencewasunavailable wrote:
> > I need to let my users do backups and restores from the
> > I've downloaded IBOAdmin, which seems like it ought to be ableto do
> > what I want, and I've managed to successfully compile andinstall it.
> >of its
> > Is there any documentation anywhere on how to use it? Examples
> > use?pretty much done
>
> Here's the function I use to restore DBs with it. Backup is
> by replacing "Restore" with "Backup" and removing the APageSizeparam. We
> only use the embedded version, so no idea if this will work onClassic.
>TIB_Session):
> This is adapted from the examples Helen mentioned.
>
> function RestoreFirebirdDB(
> ABackupFileName, ADBFileName, AUsername, APassword: String;
> AOptions: TRestoreOptions; APageSize: Integer; ASession:
> Boolean;others go through
> var
> RestoreSvc: TIBORestoreService;
> begin
> Result := False;
>
> if not FileExists(ABackupFileName) then
> begin
> Exit;
> end;
>
> try
> RestoreSvc := TIBORestoreService.Create(nil);
> try
> RestoreSvc.Session := ASession;
> RestoreSvc.BackupFile.Add(ABackupFileName);
> RestoreSvc.DatabaseName.Add(ADBFileName);
> RestoreSvc.PageSize := APageSize;
> RestoreSvc.Options := AOptions;
> RestoreSvc.LoginPrompt := False;
> RestoreSvc.Params.Add('user_name=' + AUsername);
> RestoreSvc.Params.Add('password=' + APassword);
>
> RestoreSvc.Active := True;
> try
> RestoreSvc.ServiceStart;
> while RestoreSvc.IsServiceRunning do
> begin
> Sleep(1);
> end;
> finally
> RestoreSvc.Active := False;
> end;
>
> Result := True;
> finally
> RestoreSvc.Free;
> end;
> except
> // Trap IBO Admin exceptions and just return False. All
> // to the caller.Thanks, Toby. It seems to work with the superserver version as well.
> on EIBOInterBaseError do
> begin
> end;
> on EIBOInterBaseRoleError do
> begin
> end;
> on EIBOClientError do
> begin
> end;
> else
> raise;
> end;
> end;
>
> --
> Toby
>