加密你的ACCESS数据库
类别: ASP教程
Secure Your Access Database
How can you keep unwanted people from downloading your database simply by typing in the url?
You can\'t, it is not possible. BUT you can secure it by adding a password to it. Below I will
walk you through the steps needed to accomplish this.
1. Download your database (new feature added today, see above).
2. Open it up in MS Access. (Check the "Exclusive" checkbox in the file dialog box. If you don\'t,
Access will ask you to later.)
3. Menu Bar --> Tools --> Security --> Set Database Password Select "Tools" from the menu bar,
then "Security", then "Set Database Password."
4. Your password can be: (quoted from MS Access Help) "Passwords can be any combination of 14 or
fewer characters, except control characters. Passwords are case-sensitive."
5. Upload your password protected database to Brinkster.
6. What needs to be changed in your code:
Only your connection string needs to be changed. Here is a sample:
Set Conn = Server.CreateObject("ADODB.Connection")
MyConnStr = "DRIVER={Microsoft Access Driver (*.mdb)}; "
MyConnStr = MyConnStr & "DBQ=d:sitesmembernamedbmydbase.mdb; "
MyConnStr = MyConnStr & "PWD=yourpassword"
Conn.Open(MyConnStr)
Add the "PWD=yourpassword" to the connection string and you are set!
7. In the SQL Mgr, a new field has been added for password. This way you can still use the SQL
Mgr, even if your Access database has been password protected!
How can you keep unwanted people from downloading your database simply by typing in the url?
You can\'t, it is not possible. BUT you can secure it by adding a password to it. Below I will
walk you through the steps needed to accomplish this.
1. Download your database (new feature added today, see above).
2. Open it up in MS Access. (Check the "Exclusive" checkbox in the file dialog box. If you don\'t,
Access will ask you to later.)
3. Menu Bar --> Tools --> Security --> Set Database Password Select "Tools" from the menu bar,
then "Security", then "Set Database Password."
4. Your password can be: (quoted from MS Access Help) "Passwords can be any combination of 14 or
fewer characters, except control characters. Passwords are case-sensitive."
5. Upload your password protected database to Brinkster.
6. What needs to be changed in your code:
Only your connection string needs to be changed. Here is a sample:
Set Conn = Server.CreateObject("ADODB.Connection")
MyConnStr = "DRIVER={Microsoft Access Driver (*.mdb)}; "
MyConnStr = MyConnStr & "DBQ=d:sitesmembernamedbmydbase.mdb; "
MyConnStr = MyConnStr & "PWD=yourpassword"
Conn.Open(MyConnStr)
Add the "PWD=yourpassword" to the connection string and you are set!
7. In the SQL Mgr, a new field has been added for password. This way you can still use the SQL
Mgr, even if your Access database has been password protected!
- 上一篇: 实用函数- 判断输入的是否是电话号码
- 下一篇: 利用GLOBAL.ASP定时执行ASP
-= 资 源 教 程 =-
文 章 搜 索