用copyfile
procedure TFVindicate.BitBtn4Click(Sender: TObject);
var dao:OLEVariant;
str:String;
begin
BitBtn4.Enabled:=false;
str:=ExtractFilePath(Application.ExeName);
FMainForm.adoConn.Close;//揤坫岆眕黃梩源宒輛俴腔˙揤坫猁壽敕杅擂踱蟀諉﹝
screen.Cursor:=crHourGlass;
dao:=CreateOleObject('DAO.DBEngine.36');//'DAO.DBEngine.36'珩褫眕,祥眭耋岆祥岆access2000猁蚚dao3.6,扂婓access97奻蚚35睿36飲褫眕
dao.CompactDatabase(str+'Data.mdb',str+'Data1.mdb');
DeleteFile(str+'Data.mdb');
RenameFile(str+'Data1.mdb',str+'Data.mdb');
FMainForm.adoConn.Open;
screen.Cursor:=crDefault;
ShowMessage('揭燴俇救!');
BitBtn4.Enabled:=true;
end;