改变ACCESS数据库的密码

2016-02-19 13:30 0 1 收藏

生活已是百般艰难,为何不努力一点。下面图老师就给大家分享改变ACCESS数据库的密码,希望可以让热爱学习的朋友们体会到设计的小小的乐趣。

【 tulaoshi.com - 编程语言 】

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

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

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

If Dir(DBPath) = "" Then Exit Function

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

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

来源:https://www.tulaoshi.com/n/20160219/1604494.html

延伸阅读
How to speed up database access Here is a trick to loop through a recordset faster. Often when looping through a recordset people will use the following code: Do While Not Records.EOF   Combo1.AddItem Records![Full Name]   Eecords.Movenext LoopThe problem is that everytime the database moves to the next re...
标签: Web开发
一.建立数据库及ODBC数据源 1.建立jcc.mdb数据库及user表      2.添加测试数据 3.配置ODBC数据源 二.在%wwwroot%/下,新建Access数据库连接文件Select.jsp Select.jsp源码如下: %@page contentType="text/html;charset=gb2312"% %@page import="java.sql.*"% html body ...

经验教程

175

收藏

69
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部