Re: Access Compact

From: Dave Blake (barnswood_at_hotmail.com)
Date: 08/09/04


Date: Mon, 9 Aug 2004 07:06:29 +0100


"Ryan L. Schoolman" wrote
> how do you compact an Access database ?
>
 You search this ng on google and read the answer, it has been answered many
times before.

It is not an ADO function. Instead import the JRO type library and do
something like

var
  MyJetEngine: JetEngine;
begin
  strDataSource := 'Data Source=c:\yourdir\yourdb.mdb;';
  strDataDest := 'Data Source=c:\yourdir\your_compacted_db.mdb;' +
                   'Jet OLEDB:Engine Type=5';
                   {Use Engine Type 5 for Access 2000 db}
                   {Use Engine Type 4 for Access 97 db }
  MyJetEngine := CoJetEngine.Create();
  try
    MyJetEngine.CompactDatabase(strDataSource, strDataDest);
  finally
    MyJetEngine := nil;
  end;

For more help use Google, the answers are there.

Dave



Relevant Pages

  • Re: OT, welcome (was: Re: To enter and access database of MS access or any DBMS usibg C.)
    ... welcome (was: Re: To enter and access database of MS access or any ... Google response: "OT, Google boilerplate". ... since I believe that by consensus strictly such posts are not off-topic, ... have reread enough posts containing solely advice such as proper Google ...
    (comp.lang.c)
  • Re: Access Database error with ADO
    ... Google returns 80040e14 code for this error in most items. ... MSDN for possible solution. ... > I've just deployed an application written in D7 with an Access database ... The app was tested the app on ...
    (borland.public.delphi.database.ado)
  • Re: Real Analysis Contininous Function
    ... image of a compact set is compact. ... Then fis compact subset of a linear order, or a compact subset of R. ... Beware of using Google groups. ...
    (sci.math)
  • ODBC connection to mdb for MacIntosh
    ... I've seen tantalizing hints on Google that it might be possible to create an ... ODBC connection to an Access database on a Mac, but have not been able to ...
    (microsoft.public.mac.otherproducts)
  • Re: Dual of locally compact abelian group
    ... is itself locally compact? ... If you google ... "LOCAL COMPACTNESS OF THE DUAL GROUP USING ASCOLI..." ...
    (sci.math)