[firebase-br] IBBackupService: como descobrir e tratar erros

Valdir Marcos valdir.marcos em ig.com.br
Qui Nov 17 21:40:24 -03 2005


Delphi 7 + IBX + FB 1.5.2.4787

1. Pessoal, como descobrir se houve algum erro durante o evento de backup 
abaixo?
2. Um simples Try/Except resvolveria para tratar os erros no evento abaixo?

Um abraço,

Valdir Marcos


http://bdn.borland.com/article/borcon/files/6100/paper/6100.html#IBBackupService
procedure TMainForm.BackupBtnClick(Sender: TObject);
begin
  with IBBackupService do
  begin
    BuMemo.Lines.Clear;
    try
      ShowWait;
      Active := True;
      ServiceStart;
      while not EOF do      begin
        BuMemo.Lines.Add(GetNextLine);        Application.ProcessMessages; 
end;       end;
    finally
      Active := False;
      ShowNormal;
    end; //try
  end; //with
end;
IBBackupService
In this example the output of the backup operation is shown in the memo 
component named BuMemo. To retrieve the backup progress messages you must 
set the Verbose property to True then call the GetNextLine method repeatedly 
until the backup is finished. In the code shown above setting the Active 
property to True attaches the component to the Interbase backup service on 
the designated server. Calling the ServiceStart method actually starts the 
backup operation. The while loop calls GetNextLine to retrieve the next 
progress message and adds the message to the memo component. This continues 
until the IBBackup component's EOF property is True signalling the end of 
the backup.

The Options property of IBBackupService gives you the same backup options 
provided by gbak. The options are:

      IgnoreChecksum Ignore checksum errors in the database.
      IgnoreLimbo Ignore transactions in the limbo state.
      MetadataOnly Backup the metadata but not the data so a restore will 
create a new empty database.
      NoGarbageCollection Do not delete old record versions.
      OldMetadataDesc Backup metadata in the old format.
      NonTransportable Backup in non-transportable format. This will be 
faster but the backup cannot be restored on another platform.
      ConvertExtTables Convert external tables to internal tables and back 
them up.





Mais detalhes sobre a lista de discussão lista