程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Access數據庫 >> Access數據庫入門 >> 改變ACCESS數據庫的密碼

改變ACCESS數據庫的密碼

編輯:Access數據庫入門

Public Function ChangeDatabasePassword(DBPath As String, _
newPassword As String, oldPassWord As String) As Boolean
   
`Usage: Change DatabasePassword
`Parameters: sDBPath: Full Path to Access Database

`newPassword: the password
`oldPassword: the previous password
`returns true on success false otherwise

If Dir(DBPath) = "" Then Exit Function

Dim db As DAO.Database

On Error Resume Next
Set db = OpenDatabase(DBPath, True, False, ";pwd=" & oldPassWord)
If Err.Number <> 0 Then Exit Function
db.newPassword oldPassWord, newPassword
ChangeDatabasePassword = Err.Number = 0
db.Close

End Function

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved