About the compression and repair database functionality for access

Source: Internet
Author: User
Tags file size access database

A friend who has used an Access database must know that there is a "Compress and Repair Database" feature.

<?xml:namespace prefix = o ns = "Urn:schemas-microsoft-com:office:office"/>

why "Compress and repair Databases"

The first is of course compression, reducing file size. Because access is a file-type database, all of its data is actually stored in a file with an MDB extension, so this form of database is sometimes referred to as the flat file class database. Of course, MS has always changed the name to change the habit, so in Access 2007, the new format of Access database file extension has become accdb:). As the data in the database is constantly increasing, modifying and deleting, the volume of the database file is increasing. Even if you delete some data, the file size is actually not reduced. This is because when the data is deleted, it is actually only marked as "deleted" in the database, not really deleted.

Second, repair the database files. It is risky to actually put all of the database data on a disk file. Once this file is corrupted, it can cause trouble opening the database file. This Access database may no longer be opened because of inconsistencies in the access file that are caused by various external causes. Especially when there are multiple clients accessing the same database, such as a typical small web site that uses an Access database, it is more prone to "write inconsistencies".

how "Compress and Repair Database" works

When you perform this function, a temporary Access file is created, and all data records in the files that need to be compressed are then directed to the temporary file and the original file is deleted. Finally, the temporary file renamed to the original file name, copied back to the original directory.

How does the "Compress and Repair Database" feature not be found in Access 2007 ?

Compared to the previous version, the program interface and functional classifications in Office 2007 were significantly tweaked to make it easier for users to find the most common features and improve their experience. Indeed, such improvements deserve recognition. You may not get used to it at first, but it takes a while to feel really handy. But for a feature like "Compress and repair a database," It's not easy to find it all at once. In previous access 2000/xp/2003, this feature was in the tool menu item, but this was required in Access 2007:

Click the Office button <?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml"/>, point to manage, and then under Manage this database, click Compress and Repair Database.

Http://office.microsoft.com/client/helppreview.aspx? Assetid=ha102355832052&queryid=3f9dvocsl&respos=1&rt=2&ns=msaccess&lcid=2052&pid= Ch100948232052#3

Hehe, if do not look for help, is to look for a while.

how to "compress and repair a database" Outside of an access program

You can pass the "JRO" in MDAC. JetEngine "object to compress an Access file, the method name is CompactDatabase.

If you need the interface, of course, you can use DELPHI/VB and so on to draw one, and then call this method.

Even Microsoft officially released a tool called "Jet Database Compact Utility" around 2000. One of the things I've seen is version 4.0 (consistent with Jet version), with some additional options in addition to the compression feature.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.