Board index » delphi » how to compact access database

how to compact access database


2006-01-11 03:03:33 PM
delphi258
hi
Is there a way to call ADO to compact the database?
thanks
chris
 
 

Re:how to compact access database

Import "Microsoft Jet and Replication Objects 2.x Library" (project\import
type library in menu). Database should be disconnected when you compact and
repair it. Jet compacts database into
another file.
uses
JRO_tlb;
var
JetEngine: IJetEngine;
begin
JetEngine := CoJetEngine.Create();
JetEngine.CompactDatabase('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' +
dbSource,
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + dbDest);
JetEngine := nil;
end;
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Christopher" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях следующе?
Quote
hi
Is there a way to call ADO to compact the database?

thanks
chris