permissions problem using bypass key enable function

PaulA

Registered User.
Local time
Today, 00:29
Joined
Jul 17, 2001
Messages
416
I obtained an application from this forum for enabling and disabling the startup bypass key.

For some reason, a database where it original worked is not generating an error message that I don't have neccessary permissions to use the "MSysDB" object.

The database to enable/disable is configured to a security workgroup although the enable/disable application is not. This has never been a problem before.

How can I get the application to work on the database? I don't know how to even set a permission for "MSysDb" object!!

Thanks!!!
 
The applications I have seen around these posts do not have the functionality to externally
disable the BypassKey on a secured database.

My code below is designed to work within the database.

Code:
'The below function and command button code will allow you to use a password protected input box to determine if the Shift key can be disabled or not.
    
'You might have to set your "References" to DAO 3.6. When you are viewing
'the module, click the Tools menu >>> References >>>  and Browse for Microsoft
'DAO 3.6 >>> Select "Files of type: Executable Files (*.exe; *.dll)"
'My DLL was located @ C:\Program Files\Common Files\Microsoft Shared\DAO.
'Copy this function into a new public module.
Public Function SetProperties(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
On Error GoTo Err_SetProperties
    
    'Dim db As Database, prp As Property
    Dim db As DAO.Database, prp As DAO.Property
    
    Set db = CurrentDb
    db.Properties(strPropName) = varPropValue
    SetProperties = True
    Set db = Nothing
    
Exit_SetProperties:
    Exit Function
    
Err_SetProperties:
    If Err = 3270 Then 'Property not found
        Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
        db.Properties.Append prp
        Resume Next
    Else
        SetProperties = False
        MsgBox "Runtime Error # " & Err.Number & vbCrLf & vbLf & Err.Description
        Resume Exit_SetProperties
    End If
    
End Function
    
'Assign this to the OnClick event of a command (transparent?) button named "bDisableBypassKey".
'Change the "TypeYourBypassPasswordHere" default password.
'This sub ensures the user is the programmer needing to disable the Bypass Key.
'Change the "TypeYourBypassPasswordHere" default password.
'You can not format an Input Box!
    
Private Sub bDisableBypassKey_Click()
On Error GoTo Err_bDisableBypassKey_Click
    
    Dim strInput As String
    Dim strMsg As String
    
    Beep
    strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & "Please key the programmer's password to enable the Bypass Key."
    strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
    
    If strInput = "TypeYourPasswordHere" Then
        SetProperties "AllowBypassKey", dbBoolean, True
        Beep
        MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & "The Shift key will allow the users to bypass the startup options the next time the database is opened.", vbInformation, "Set Startup Properties"
    Else
        Beep
        SetProperties "AllowBypassKey", dbBoolean, False
        MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & "The Bypass Key was disabled." & vbCrLf & vbLf & "The Shift key will NOT allow the users to bypass the startup options the next time the database is opened.", vbCritical, "Invalid Password"
        Exit Sub
    End If
    
Exit_bDisableBypassKey_Click:
    Exit Sub
    
Err_bDisableBypassKey_Click:
    MsgBox "Runtime Error # " & Err.Number & vbCrLf & vbLf & Err.Description
    Resume Exit_bDisableBypassKey_Click
    
End Sub
HTH
 
I've seen the utility you're talking about but it didn't come from here. I checked Tek-Tips and Utter Acces and couldn't find where it came from but I have a copy. Attached it here. If you need A97 let me know.

Autoeng
 

Attachments

Users who are viewing this thread

Back
Top Bottom