functionGetTempPathFileName():string;
var
SPath,SFile:array[0..254]ofchar;
begin
GetTempPath(254,SPath);
GetTempFileName(SPath,~SM,0,SFile);
result:=SFile;
DeleteFile(result);
end;
functionCompactDatabase(AFileName,APassWord:string):boolean;
//紧缩与修单数据库,掩盖源文件
var
STempFileName:string;
vJE:OleVariant;
begin
STempFileName:=GetTempPathFileName;
try
vJE:=CreateOleObject(JRO.JetEngine);
vJE.CompactDatabase(format(SConnectionString,[AFileName,APassWord]),
format(SConnectionString,[STempFileName,APassWord]));
result:=CopyFile(PChar(STempFileName),PChar(AFileName),false);
DeleteFile(STempFileName);
except
result:=false;
end;
end;