FileName:=ExtractFilePath(paramstr(0))+'\DataBase\Data.mdb'; //取得源文件路径 SaveFile:= Rzbuttonedit1.Text +'\'+Rzedit1.Text +'.mdb'; //目标文件路径 if FileExists(SaveFile) then begin if Application.MessageBox('是否覆盖原来的文件?', '提示', Mb_YesNo or Mb_Iconquestion) = idyes then try DeleteFile(SaveFile); except exit; end; end; try copyfile(pchar(filename),pchar(savefile),false); Application.MessageBox('备份成功!', '提示', Mb_ok or Mb_Iconinformation); except Application.MessageBox('备份失败!', '提示', Mb_ok or Mb_Iconerror); end;
SaveFile:= Rzbuttonedit1.Text +'\'+Rzedit1.Text +'.mdb'; //目标文件路径
if FileExists(SaveFile) then
begin
if Application.MessageBox('是否覆盖原来的文件?', '提示', Mb_YesNo or Mb_Iconquestion) = idyes then
try
DeleteFile(SaveFile);
except
exit;
end;
end;
try
copyfile(pchar(filename),pchar(savefile),false);
Application.MessageBox('备份成功!', '提示', Mb_ok or Mb_Iconinformation);
except
Application.MessageBox('备份失败!', '提示', Mb_ok or Mb_Iconerror);
end;