PC Review


Reply
Thread Tools Rate Thread

CompactDatabase Ain't Doing @#$%

 
 
=?Utf-8?B?QkNQ?=
Guest
Posts: n/a
 
      20th Jul 2007
I am executing DBEngine.CompactDatabase on a database in a VBA module. When
the compact finishes the compacted database is a few Mb smaller. If I go
into that database a run a compact the compacted database shrinks by more
than half.

Any guesses why CompactDatabase is failing to compact my database.

I look forward to your great help once again - BCP
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWF1cmljZQ==?=
Guest
Posts: n/a
 
      20th Jul 2007
Compacting via VBA can be a problem because the db has to be closed to
actually be compacted. That's why compacting from code will not fully be
compacted. When compacting manually you'll notice that access actually makes
a db1 and then renames it again to you official db name. If going through
code you should create a seperate db from which you can compact the original.
--
Maurice Ausum


"BCP" wrote:

> I am executing DBEngine.CompactDatabase on a database in a VBA module. When
> the compact finishes the compacted database is a few Mb smaller. If I go
> into that database a run a compact the compacted database shrinks by more
> than half.
>
> Any guesses why CompactDatabase is failing to compact my database.
>
> I look forward to your great help once again - BCP

 
Reply With Quote
 
=?Utf-8?B?RENQYW4=?=
Guest
Posts: n/a
 
      21st Jul 2007
Why not just set the "compact on close" option and not worry about it?

"BCP" wrote:

> I am executing DBEngine.CompactDatabase on a database in a VBA module. When
> the compact finishes the compacted database is a few Mb smaller. If I go
> into that database a run a compact the compacted database shrinks by more
> than half.
>
> Any guesses why CompactDatabase is failing to compact my database.
>
> I look forward to your great help once again - BCP

 
Reply With Quote
 
George Nicholson
Guest
Posts: n/a
 
      23rd Jul 2007
> Why not just set the "compact on close" option and not worry about it?

...because in a split database situation, backends don't usually get "opened"
in such a way that "compact on close" has any effect, and frontends should
either be .mdes or contain so little data that 'compact on close' won't be
doing much of anything.

(If CompactOnClose is set in the frontend file, it will only effect the fe
file, not the backend.)

HTH,

"DCPan" <(E-Mail Removed)> wrote in message
news:1A0A9A64-9940-4292-B6A9-(E-Mail Removed)...
> Why not just set the "compact on close" option and not worry about it?
>
> "BCP" wrote:
>
>> I am executing DBEngine.CompactDatabase on a database in a VBA module.
>> When
>> the compact finishes the compacted database is a few Mb smaller. If I go
>> into that database a run a compact the compacted database shrinks by more
>> than half.
>>
>> Any guesses why CompactDatabase is failing to compact my database.
>>
>> I look forward to your great help once again - BCP



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CompactDatabase needs a Flush ? Peter Microsoft Access VBA Modules 0 4th Dec 2008 08:36 AM
DAO COMPACTDATABASE ERRORS =?Utf-8?B?QW50aG9ueQ==?= Microsoft Access 1 13th Oct 2007 03:59 PM
DBEngine.CompactDatabase =?Utf-8?B?S2V2aW4gTWNDYXJ0bmV5?= Microsoft Access Form Coding 1 20th Apr 2007 06:21 PM
CompactDatabase Ado 2.6 does not function =?Utf-8?B?U3RlZmFubw==?= Windows Vista General Discussion 5 16th Nov 2006 04:30 PM
Re: DAO CompactDatabase Method M.L. Sco Scofield Microsoft Access 0 30th Oct 2003 08:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:07 AM.