Пример из справки (нужен unit IBServices).
TIBBackupService allows you to back up your database.
Код:
This example shows a component that backs up a database with the click of a button. The second example shows how to back up a database to multiple files.
procedure TForm1.Button1Click(Sender: TObject);
begin
with IBBackupService1 do
begin
ServerName := 'Poulet';
LoginPrompt := False;
Params.Add('user_name=sysdba');
Params.Add('password=masterkey');
Active := True;
try
Verbose := True;
Options := [NonTransportable, IgnoreLimbo];
DatabaseName := 'c:\interbase\examples\database\employee.gdb';
BackupFile.Add('c:\temp\employee1.gbk');
ServiceStart;
While not Eof do
Memo1.Lines.Add(GetNextLine);
finally
Active := False;
end;
end;
end;
To back up a database to multiple files:
procedure TForm1.Button2Click(Sender: TObject);
begin
with IBBackupService1 do
begin
ServerName := 'Poulet';
LoginPrompt := False;
Params.Add('user_name=sysdba');
Params.Add('password=masterkey');
Active := True;
try
Verbose := True;
Options := [MetadataOnly, NoGarbageCollection];
DatabaseName := 'c:\interbase\examples\database\employee.gdb';
******BackupFile.Add('c:\temp\e1.gbk = 2048');
BackupFile.Add('c:\temp\e2.gbk' = 4096);
BackupFile.Add('c:\temp\e3.gbk'); ServiceStart;
While not Eof do
Memo1.Lines.Add(GetNextLine);
finally
Active := False;
end;
end;
end;