国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
設置只有管理員才能改變AllowBypassKey屬性
設置只有管理員才能改變AllowBypassKey屬性
tmtony翻譯:

在ACCESS的幫助文件中說明CreateProperty 方法的語法:

Set property = object.CreateProperty (name, type, value, DDL)
其實最后一個參數(shù)是這個解釋的(部分描述):

DDL 可選. 一個變量(邏輯子類型) 指定這個屬性是否為DDL對象. 缺少值為False. 如果設置為TRUE,除非他有 dbSecWriteDef 權限,用戶就不能改變或刪除這個屬性
CreateProperty 是用來創(chuàng)建或設置 AllowBypassKey 屬性如果這個屬性設為TRUE, 那就可以禁用戶近SHIFT鍵來禁止啟動屬性和AutoExec 宏. 然而,ACCESS幫助中提供的例子沒有使用第四個 DDL 參數(shù). 這意味著任何人都可以打開數(shù)據(jù)據(jù)然后用程序復位AllowBypassKey 屬性.

所以,為了限制普通用戶去改變這個屬性,所以我們設置第四個參數(shù)為TRUE 。

為了對比,我們也同時列出了ACCESS本身的例子以便參照

' *********** Code Start ***********
Function ChangePropertyDdl(stPropName As String, _
PropType As DAO.DataTypeEnum, vPropVal As Variant) _
As Boolean
' Uses the DDL argument to create a property
' that only Admins can change.
'
' Current CreateProperty listing in Access help
' is flawed in that anyone who can open the db
' can reset properties, such as AllowBypassKey
'
On Error GoTo ChangePropertyDdl_Err

Dim db As DAO.Database
Dim prp As DAO.Property

Const conPropNotFoundError = 3270

Set db = CurrentDb
' Assuming the current property was created without
' using the DDL argument. Delete it so we can
' recreate it properly
db.Properties.Delete stPropName
Set prp = db.CreateProperty(stPropName, _
PropType, vPropVal, True)
db.Properties.Append prp

' If we made it this far, it worked!
ChangePropertyDdl = True

ChangePropertyDdl_Exit:
Set prp = Nothing
Set db = Nothing
Exit Function

ChangePropertyDdl_Err:
If Err.Number = conPropNotFoundError Then
' We can ignore when the prop does not exist
Resume Next
End If
Resume ChangePropertyDdl_Exit
End Function

幫助本身的例子
Function ChangeProperty(strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Integer
' The current listing in Access help file which will
' let anyone who can open the db delete/reset any
' property created by using this function, since
' the call to CraeteProperty doesn't use the DDL
' argument
'
Dim dbs As Database, prp As Property
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
' *********** Code End ***********
本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
AllowBypassKey 屬性
如何在Access中屏蔽Shift鍵?[ACCESS中國/OFFICE中國(access技...
金屬材料屬性 - Material Properties
Cesium原理篇:Property
一分鐘了解PRP
【轉(zhuǎn)】(筆記)VS2005未使用調(diào)試信息生成二進制文件解決方法辦法中文英文版對應
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服