U
ugvanxk
Unregistered / Unconfirmed
GUEST, unregistred user!
假设此数据库的密码是 idlehagar
use JRO_TLB;
procedure CompactMdb;
const sProvider = 'Provider=Microsoft.Jet.OLEDB.4.0;';
var oJetEng: JetEngine;
sOldMdb, sNewMdb: string;
begin
sOldMdb := sProvider + 'Data Source=' + 'C:/Database/Test.mdb;'
+ 'Jet OLEDBatabase Password=idlehagar';
sNewMdb := sProvider + 'Data Source=' + 'C:/Test.mdb;'
+ 'Jet OLEDBatabase Password=idlehagar';
try
try
oJetEng := CoJetEngine.Create;
oJetEng.CompactDatabase(sOldMdb, sNewMdb);
if FileExists('C:/Test.mdb') then begin
CopyFile('C:/Test.mdb', 'C:/Database/Test.mdb', False);
DeleteFile('C:/Test.mdb');
end;
except
on E: Exception do
showmessage('Compact database failed');
end
finally
oJetEng := nil;
end;
end;
提示jro_tlb没有找到,到哪里找,其他的办法。
压缩,备份,恢复
use JRO_TLB;
procedure CompactMdb;
const sProvider = 'Provider=Microsoft.Jet.OLEDB.4.0;';
var oJetEng: JetEngine;
sOldMdb, sNewMdb: string;
begin
sOldMdb := sProvider + 'Data Source=' + 'C:/Database/Test.mdb;'
+ 'Jet OLEDBatabase Password=idlehagar';
sNewMdb := sProvider + 'Data Source=' + 'C:/Test.mdb;'
+ 'Jet OLEDBatabase Password=idlehagar';
try
try
oJetEng := CoJetEngine.Create;
oJetEng.CompactDatabase(sOldMdb, sNewMdb);
if FileExists('C:/Test.mdb') then begin
CopyFile('C:/Test.mdb', 'C:/Database/Test.mdb', False);
DeleteFile('C:/Test.mdb');
end;
except
on E: Exception do
showmessage('Compact database failed');
end
finally
oJetEng := nil;
end;
end;
提示jro_tlb没有找到,到哪里找,其他的办法。
压缩,备份,恢复