在ADP/ADE中禁止SHIFT键的方法
Function DisableBypassADP(blnYesNo As Boolean)
CurrentProject.Properties.Add "AllowByPassKey", blnYesNo
End Function
然后在启动时调用 DisableBypassADP(false)
更详细的做法:
Function SetMyProperty(MyPropName As String, MyPropvalue As Variant) As Boolean
On Error GoTo SetMyProperty_In_Err
Dim Ix As Integer
With CurrentProject.Properties
If fn_PropertyExist(MyPropName) Then 'check if it already exists
For Ix = 0 To .Count - 1
If .Item(Ix).Name = MyPropName Then
.Item(Ix).value = MyPropvalue
End If
Next Ix
Else
.Add MyPropName, MyPropvalue
End If
End With
SetMyProperty = True
SetMyProperty_Exit:
Exit Function
SetMyProperty_In_Err:
MsgBox "设置属性出错:", Err, Error$
SetMyProperty = False
Resume SetMyProperty_Exit
End Function
'--------检查属性是否存在---
Private Function fn_PropertyExist(MyPropName As String) As Boolean
fn_PropertyExist = False
Dim Ix As Integer
With CurrentProject.Properties
For Ix = 0 To .Count - 1
If .Item(Ix).Name = MyPropName Then
fn_PropertyExist = True
Exit For
End If
Next Ix
End With
End Function
Public Function setByPass()
SetMyProperty "AllowBypassKey", True
End Function
(责任编辑:admin)
- ·ACCESS丢失MDW,还能还原用户与用户组及
- ·【技巧】如何让Access更加安全
- ·Access数据库安全中常见问题汇总
- ·数据库的安全为什么要侧重于网络系统
- ·建立Access数据库的安全门
- ·如何能通过窗体访问表,但不能直接读取
- ·Access 2007 中的用户级安全
- ·如何用二进制方式编辑 MDB 使 ACCESS
- ·Access限制软件30天试用
- ·Access处理加了密码的MDB数据库文件
- ·EXE修改安全级别并启动ACCESS项目
- ·处理加了密码的MDB数据库文件
- ·Access如何解除VBAProject 的口令保护
- ·保护Access 2000数据库的安全
- ·Access数据库安全五招
- ·Access 数据库安全攻防策略