A
arista
Hi
after a long time playing with disallowing SHIFT Bypass I decided to ask you
for help.
I did following:
1) paste function ChangePropertyDdl into separate module called Security
(function from recommended web site
http://www.mvps.org/access/general/gen0040.htm)
Public 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
2) I added DAO 3.6 into references
3) in mdb file I run the function from the immediate window
-> then the file mdb does not allow shift bypass only for the first open; on
second open it is again possible to use shift bypass
4) I made mde file (I export this file to my clients)
5) in mde file I run the function from the button event
-> then the file mde does not allow shift bypass only for the first open; on
second open it is again possible to use shift bypass
I tried several combinations with same result.
Can anybody help please ?
after a long time playing with disallowing SHIFT Bypass I decided to ask you
for help.
I did following:
1) paste function ChangePropertyDdl into separate module called Security
(function from recommended web site
http://www.mvps.org/access/general/gen0040.htm)
Public 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
2) I added DAO 3.6 into references
3) in mdb file I run the function from the immediate window
-> then the file mdb does not allow shift bypass only for the first open; on
second open it is again possible to use shift bypass
4) I made mde file (I export this file to my clients)
5) in mde file I run the function from the button event
-> then the file mde does not allow shift bypass only for the first open; on
second open it is again possible to use shift bypass
I tried several combinations with same result.
Can anybody help please ?