代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。