标题: 如何在Access中屏蔽Shift键? [打印本页] 作者: yuankeh8 时间: 2003-7-7 21:39 标题: 如何在Access中屏蔽Shift键? 有一同事问我,如何在Access中屏蔽Shift键,使之不能通过按住Shift键来打开数据库文件(*.mdb)。记得前些日子在看贴时看到这一贴子,可现在一直找不到了,请哪位大哥指点指点。多谢! 作者: 徐阿鹏 时间: 2003-7-7 23:00
禁止用shift键
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropvalue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropvalue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropvalue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function