I created a database using Access 2002 in an Access 2000 format. The front end is Visual Basic 6. I don’t want the users to have direct access to the back end, but since security is managed by Access, if they knew what they were doing they could crack into the back end with their user level. There is a little function I found that will disable the shift key on launch, and I can set the start up options to not display any of the interface, which seems to have worked for me in the past. Now that property of the database object isn’t available that I can find. I looped through the different properties and printed them:
0 Name
1 Connect
2 Transactions
3 Updatable
4 CollatingOrder
5 QueryTimeout
6 Version
7 RecordsAffected
8 ReplicaID
9 DesignMasterID
10 Connection
11 AccessVersion
12 Build
13 ProjVer
The code I’m using errors on that property db.Properties(“AllowByPassKey”) doesn’t exist.
Function ap_DisableShift()
‘This function will disable the shift at startup causing
‘the Autoexec macro and Startup properties to always be executed
MsgBox CurrentUser
If CurrentUser = “MyUserName” And GroupMembership(CurrentUser) = “Access” Then
ap_EnableShift
Exit Function
Else
On Error GoTo errDisableShift
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
‘This next line disables the shift key on startup.
db.Properties(“AllowByPassKey”) = False
‘function successful
Exit Function
End If
errDisableShift:
‘The first part of this error routine creates the “AllowByPassKey
‘property if it does not exist.
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
I’m interested in not only if I can get this to work again, but if this is an appropriate security measure.