SoFunction
Updated on 2025-04-08

Daily maintenance methods of Access database (optimization)

Scope of application of this article: Use Access as a website for database construction.

Access database security

1. Make sure that the Access database cannot be downloaded directly, that is, your database cannot be downloaded directly through http. If you can download it, it will be exploited by hackers and steal all the information on your website.

2. Rename the Access database to a more complicated name. Do not use the default mdb extension, nor do you use asp as the extension. It is recommended not to use an extension or use a special extension, such as kjje4#.

Do not exceed 50M database size

1. According to practical summary, when the Access database exceeds 50M, the overall response of the website will become very slow, and it will also affect the performance of other websites on the server. If the data is very large, it is recommended that you migrate to our SQLServer database space.

2. If you have interactive pages such as message books on your website, be sure to set up protection measures such as verification codes to avoid the hacker's injecting a large amount of data into it and the database continues to grow larger.

3. When designing the program, please pay attention to adding database closing code at the end of the page, which is conducive to the good operation of the website. The code example is as follows:

Copy the codeThe code is as follows:


Set Rs=Nothing

Set Conn=Nothing

Compression and repair

If the Access database is not maintained for a long time, it is prone to excessive database size, slow reading or even corruption, which causes errors or abnormalities in the website to open. At this time, we can use Microsoft's Access software to compress and repair.

1. Pause the website first to prevent the Access database from reading and writing.

2. Download the Access database to the local computer through FTP software.

3. Copy this database as a backup to avoid failure to cause database damage.

4. Use Access software to open this database. Click Tools -> Database Utility in the menu bar above, and then click Compress and Repair Database.

5. Upload the repaired database into the space and overwrite the original database. Finally, open the space.