【发布时间】:2015-10-07 11:31:10
【问题描述】:
我正在尝试创建一个访问数据库,即使是绕过转移选项,用户也会关闭该数据库。我已经完成了执行此操作的代码,但我想添加的是当按下 shift 键时会弹出一个框,允许用户输入密码,并且绕过 shift 选项将再次起作用。有人知道这是否可能吗?
谢谢!
Function ap_DisableShift()
On Error GoTo errDisableShift
Dim db As DAO.Database
Dim prop As DAO.Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
Exit Function
errDisableShift:
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", _
dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function 'ap_DisableShift' did not complete successfully."
Exit Function
End If
End Function
【问题讨论】: