Microsoft KB Archive/273016

= ACC2000: Auto Compact Percentage String in SetOption Does Not Function as Expected =

Article ID: 273016

Article Last Modified on 6/25/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q273016



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
In the &quot;Set Options from Visual Basic&quot; Help topic in the Microsoft Access 2000 Visual Basic Editor, under the &quot;General Tab&quot; information, there is a feature listed that is called &quot;Compact when database will shrink by this percentage or more.&quot; The string argument of &quot;Auto Compact Percentage&quot; can be changed by using the SetOption method in Visual Basic for Applications. This feature should compact an Access database (.mdb) or an Access project (.adp) only when the file would shrink by the specified percentage or more.

The Help file is incorrect. The Auto Compact Percentage feature can be set by using SetOption and retrieved by using GetOption; however, the value is ignored by Access 2000. The compact is completed, regardless of the percentage value.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
 Create a new blank database and name it CheckCompact.mdb. Import all the objects, except for data access pages, from the sample database Northwind.mdb. On the File menu, click Database Properties. Click the General tab, and look at the size of CheckCompact.mdb. Delete all the objects, except the tables and the queries. Close CheckCompact.mdb. Create a copy of CheckCompact.mdb and name it CheckCompact2.mdb.</li> Open the CheckCompact2.mdb database.</li> On the Tools menu, point to Database Utilities, and then click Compact and Repair Database. Look at the size of the database. It should shrink by approximately 35%.</li> Open CheckCompact.mdb.</li>  Create a new module, and then add the following code: Sub TestCompact Application.SetOption &quot;Auto Compact&quot;, true Application.SetOption &quot;Auto Compact Percentage&quot;, &quot;80%&quot; End Sub NOTE: This code can be tested with any percentage greater than what you found after completing step 8. </li>  In the Immediate window, type the following line, and then press ENTER: TestCompact </li> Close CheckCompact.mdb.</li> Look at the size of CheckCompact.mdb in Windows Explorer.

NOTE: According to the Help file, the size of CheckCompact.mdb should be the same because the space to be recovered is less than 80%. However, the size of the database is smaller because the percentage was ignored and compact has been run.</li></ol>

Additional query words: pra

Keywords: kbbug kbpending KB273016

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.