1 Star 0 Fork 0

Liubaohua / 通用仓库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vba 修改access2007密码.vbs 972 Bytes
一键复制 编辑 原始数据 按行查看 历史
Liubaohua 提交于 2021-08-24 09:23 . no commit message
Sub aaa()
On Error GoTo myerr1
'Set args = wscript.Arguments
'msgbox "args.count=" & args.count
'If args.Count <> 1 Then MsgBox "need file": wscript.Quit
Dim conn As New ADODB.Connection
Set conn = New ADODB.Connection
'Set conn = CreateObject("ADODB.Connection")
connStr = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=c:\data\db.accdb;Mode=Share Deny Read|Share Deny Write;Persist Security Info=False;Jet OLEDB:Database Password=123456"
'MsgBox connStr
conn.Open connStr
conn.Execute ("ALTER DATABASE Password abcd 123456")
conn.Close
MsgBox "done"
Exit Sub
myerr1:
MsgBox Err.Description & "aa"
End Sub
---笔记
如果CreateObject("ADODB.Connection" 执行失败。
Vba 窗口 点击菜单上的"工具">>"引用",勾选它:Microsoft ActiveX Data Objects 2.x
Microsoft.Jet.OLEDB.4.0; --office2003
Microsoft.ACE.OLEDB.12.0; --office2007
ALTER DATABASE PASSWORD 新密码 旧密码
ALTER DATABASE Password new old
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chinablue2017/commproj.git
git@gitee.com:chinablue2017/commproj.git
chinablue2017
commproj
通用仓库
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891