Fire Bird 可以由程式直接做 backup 資料庫嗎 |
尚未結案
|
sarger
一般會員 發表:6 回覆:2 積分:1 註冊:2003-05-31 發送簡訊給我 |
|
hahalin
版主 發表:295 回覆:1698 積分:823 註冊:2002-04-14 發送簡訊給我 |
|
hahalin
版主 發表:295 回覆:1698 積分:823 註冊:2002-04-14 發送簡訊給我 |
|
Miles
尊榮會員 發表:27 回覆:662 積分:622 註冊:2002-07-12 發送簡訊給我 |
Hi Sarger :
我是使用InterBase不曉得有沒有相容
放一顆TIBBackupService
Sorry 裡面有一些符號無法用Code /Code包起來
procedure TMainForm.Button1Click(Sender: TObject);
var
j: integer;
lOptions: TBackupOptions;
frmVerbose : TfrmVerbose;
begin
Screen.Cursor := crHourGlass;
try
srvBackup.Attach(); lOptions := [];
if srvBackup.Active = true then
begin
{ if sgBackupOptions.Cells[OPTION_VALUE_COL,FORMAT_ROW] = 'Non-Transportable' then
begin
Include(lOptions, NonTransportable);
end; }
{ if sgBackupOptions.Cells[OPTION_VALUE_COL,METADATA_ONLY_ROW] = 'True' then
begin
Include(lOptions, MetadataOnly);
end; }
// if sgBackupOptions.Cells[OPTION_VALUE_COL,GARBAGE_COLLECTION_ROW] = 'False' then
// begin
//=====Garbage Collection False=====
Include(lOptions, NoGarbageCollection);
// end;
{ if sgBackupOptions.Cells[OPTION_VALUE_COL,TRANSACTIONS_IN_LIMBO_ROW] = 'Ignore' then
begin
Include(lOptions, IgnoreLimbo);
end;
if sgBackupOptions.Cells[OPTION_VALUE_COL,CHECKSUMS_ROW] = 'True' then
begin
Include(lOptions, IgnoreChecksums);
end;
if sgBackupOptions.Cells[OPTION_VALUE_COL,CONVERT_TO_TABLES_ROW] = 'True' then
begin
Include(lOptions, ConvertExtTables);
end; }
srvBackup.Options := lOptions; { if (sgBackupOptions.Cells[OPTION_VALUE_COL,VERBOSE_OUTPUT_ROW] = 'To Screen') or
(sgBackupOptions.Cells[OPTION_VALUE_COL,VERBOSE_OUTPUT_ROW] = 'To File') then
begin }
srvBackup.Verbose := true;
//end; { for j := 1 to sgBackupFiles.RowCount - 1 do
begin
if (sgBackupFiles.Cells[0,j] <> '') and (sgBackupFiles.Cells[1,j] <> '') then
begin
srvBackup.BackupFile.Add(Format('%s=%s',[sgBackupFiles.Cells[0,j],
sgBackupFiles.Cells[1,j]]));
end
else
if (sgBackupFiles.Cells[0,j] <> '') then
begin
srvBackup.BackupFile.Add(sgBackupFiles.Cells[0,j]);
end;
end; }
if FileExists(ExtractFilePath(Application.ExeName) 'Test2.GDB') then
DeleteFile(ExtractFilePath(Application.ExeName) 'Test2.GDB');
srvBackup.BackupFile.Add(ExtractFilePath(Application.ExeName) 'Test2.gdb');
srvBackup.DatabaseName := ExtractFilePath(Application.ExeName) 'Test.GDB';
srvBackup.ServiceStart;
if srvBackup.Verbose then
begin
frmVerbose := TfrmVerbose.Create(self);
frmVerbose.Show;
while not srvBackup.Eof do
begin
Application.ProcessMessages;
frmVerbose.edOutput.Lines.Add(srvBackup.GetNextLine)
end;
end
else
while srvBackup.IsServiceRunning do
begin
Application.ProcessMessages;
end;
end;
ShowMessage('備分成Test2.gdb完成');
finally
if srvBackup.Active then
srvBackup.Detach();
Screen.Cursor := crDefault;
end;
end; 我不是高手, 高手是正在銀幕前微笑的人.
------
我不是高手, 高手是正在銀幕前微笑的人. |
sarger
一般會員 發表:6 回覆:2 積分:1 註冊:2003-05-31 發送簡訊給我 |
|
Miles
尊榮會員 發表:27 回覆:662 積分:622 註冊:2002-07-12 發送簡訊給我 |
|
hahalin
版主 發表:295 回覆:1698 積分:823 註冊:2002-04-14 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |