Re: Estimate space freed up by compacting MS Access



"Brian Cryer" <brianc@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43f457a2$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Forgive me if this has been asked before: Is there any way of estimating
the amount of space that will be freed up by doing a compact on an
MS-Access database (without actually doing the compact)?

My reason for asking is that we have an application that uses an access
database. Rather than compact it each time we start or stop the
application (because I would rather avoid the delay), I would like to
compact it when the amount of reclaimable space goes over (say) 30%. Is
this possible?

If its relevant, I'm currently using TAdoConnection to connect to the
database, and TJetEngine to compact it.

Thanks in advance.

I've found out how if anyone is interested:

db := TAdoConnection.Create(Application);
db.ConnectionString := ...
db.Open;
reclaimableBytes := db.Properties['Jet OLEDB:Compact Reclaimed Space
Amount'].Value;

this gets returned as a string, and will probably throw an exception if you
are connected to a database other than Access.

hope this is useful to someone.
--
Brian Cryer
www.cryer.co.uk/brian


.



Relevant Pages

  • Re: Compact and Repair on Close
    ... For some reason, ... in the front-end database that is handled by the compact on close. ... I would recommend not editing stored QueryDefs in code. ...
    (microsoft.public.access.gettingstarted)
  • RE: Compacting MDB help
    ... The autoexec macro opens a ... The FrontEnd.mdb's main switchboard has a cbo to switch back end ... FECompact.mdb runs the few lines of code to compact the FrontEnd.mdb ... I'm quite certain that you can't Compact an open database from within itself ...
    (microsoft.public.access.modulesdaovba)
  • RE: Compacting MDB help
    ... This will cause the database to grow so Compacting ... not split off the tables from your FrontEnd. ... The FrontEnd.mdb's main switchboard has a cbo to switch back end ... FECompact.mdb runs the few lines of code to compact the FrontEnd.mdb ...
    (microsoft.public.access.modulesdaovba)
  • RE: Compacting MDB help
    ... not practical to have staffpersons open another database in order to switch ... When the front end opens, it goes directly to the main switchboard. ... the only reason why you would need to Compact the ...
    (microsoft.public.access.modulesdaovba)
  • Re: Access crashes when opening form
    ... Allen Browne - Microsoft MVP. ... You were correct in suspecting SP3. ... I've also had a problem with "compact on close" not working (it ... database works correctly there. ...
    (microsoft.public.access.forms)