I don't need to talk about the importance of the website database. The account and password of the website administrator are stored in it. There are many ways to protect the database from being downloaded. Below we recommend several methods to prevent the database from being Down, users who buy a virtual space can lengthen the name of the database and modify the suffix. If you have server permissions, you can set URL redirection for the database to prevent mdb files from being downloaded. Today, we will introduce you to the Database Password adding method. Even if the database is downloaded, it cannot be opened without a password.
First, open Microsoft Access and select Open in exclusive mode. Then, choose tools> Security> set database password from the menu. In this way, you can. No matter who opens the encrypted database in the future, the system will prompt you to enter the password.
How can asp access a database with a password? You only need to add a piece of code to the configuration file conn. asp. Here we will use the mobile and easy website content management system that webmasters are familiar with to demonstrate how to modify the mobile and easy root directory conn. the database connection code in asp. We set ConnStr = "Provider = Microsoft. jet. OLEDB.4.0; Data Source = "& Server. mapPath (db) is changed to ConnStr = "Provider = Microsoft. jet. OLEDB.4.0; Data Source = "& Server. mapPath (db) & "; User ID = admin; Password =; Jet OLEDB: Database Password = 123456", where 123456 is the Password you just set.
If the website is non-dynamic and easy to use, you can make corresponding changes according to the code below the corresponding configuration file.
<%
Connstr = "DBQ =" + server. mappath ("Server. mdb ") +"; DefaultDir =; DRIVER = {Microsoft Access Driver (*. mdb)}; pwd = 123456 ;"
Set conn = server. createobject ("ADODB. CONNECTION ")
Conn. open connstr
%>