压缩数据库,错误为停用了“调用取消”?(0分)

  • 主题发起人 主题发起人 pokar
  • 开始时间 开始时间
P

pokar

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TMainForm.ESimageFM12Click(Sender: TObject);
var
X: OleVariant;
sourcefiles,tempfiles:string;
begin
dm1.ADO1.Connected:=False;
mainform.Dconnent.Connected:=False;
sourcefiles:=extractfilepath(application.exename)+'hy.hyi';
tempfiles:=extractfilepath(application.exename)+'temp.hyi';
try
X:= createoleobject('JRO.JetEngine');
x.CompactDatabase('Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+sourcefiles+'','Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+tempfiles+'','',0,';pwd=jyssoft_hongyi');
if fileExists(sourcefiles) and FileExists(tempfiles) then
if deleteFile(sourcefiles)then
RenameFile(tempfiles,sourcefiles);
except
x.Release;
end;
dm1.ADO1.Connected:=True;
mainform.Dconnent.Connected:=True;
end;
 
后退
顶部