Delphi kullanarak MS-Access Veri Tabanının Sıkıştırılması - Onarılması
by admin,# MS-Access veri tabanını uygulama içinde sıkıştırmaya ve onarmaya yarıyor.
# MS-Access data base and to repair injuries to the application is the compression.
# D6-BDS2006-CG2007
PHP Kodu:
CompactAndRepair(sOldMDB : String; sNewMDB : String) : Boolean;
const
sProvider = ‘Provider=Microsoft.Jet.OLEDB.4.0;’;
var
oJetEng : JetEngine;
begin
sOldMDB := sProvider + ‘Data Source=’ + sOldMDB;
sNewMDB := sProvider + ‘Data Source=’ + sNewMDB;
try
oJetEng := CoJetEngine.Create;
oJetEng.CompactDatabase(sOldMDB, sNewMDB);
oJetEng := Nil;
Result := True;
except
oJetEng := Nil;
Result := False;
end;
end;
if
CompactAndRepair(‘e:\Old.mdb’, ‘e:\New.mdb’) then
ShowMessage(‘İşlem Başarılı.’)
else
ShowMessage(‘İşlemde Hata Oluştu.’);
# Önemli Not:
1- JRO_TLB unit ini uses bölümüne ekleyin.
2- Database sıkıştırılırken kimse database i açıp kullanmamalıdır.
3- Eðer JRO_TLB unit i ile ilgili Delphi hata verirse aşağıdakileri yapın
a) Delphi menüsünde Project - Import Type Library i seçin
b) “Microsoft Jet and Replication Objects 2.1 Library” i bulun.
c) Install butonunu tıklayın.
d) Programınızı tekrar derleyin
# Important Note:
1 - JRO_TLB unit will add to the uses section.
2 - Database compression are open and i should not use one database.
3 - If i JRO_TLB unit gives the following error related to Delphi
a) Delphi menu Project - Select Import Type Library
b) “Microsoft Jet and Replication Objects 2.1 Library” i found.
c) Click the Install button.
d) Compile your program again
1 - JRO_TLB unit will add to the uses section.
2 - Database compression are open and i should not use one database.
3 - If i JRO_TLB unit gives the following error related to Delphi
a) Delphi menu Project - Select Import Type Library
b) “Microsoft Jet and Replication Objects 2.1 Library” i found.
c) Click the Install button.
d) Compile your program again
Tags: Delphi, MS-Access, rar, skıştırmak, zip
