Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Location
    Virginia
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reset AllowByPassKey property back to True (A2K/A2K2)

    Can anyone help with the VBA to reset the AllowByPassKey to True.

    Person set it false and left. No back up to be had.

    Need to change Oracle property timeout in query in autoexec macro so ODBC conncetion will not time out.

    TIA.

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reset AllowByPassKey property back to True (A2K/A2K2)

    Code from the help is:
    Sub SetBypassProperty()
    Const DB_Boolean As Long = 1
    ChangeProperty "AllowBypassKey", DB_Boolean, False
    End Sub

    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

    You must create an autokey macro group to select what bypass keys you want to use. I assume whoever created the disable startup method on your database created two autokeys...one to turn bypass on and one to turn bypass off. Do they have a phone where they left to? I'd be calling it.
    NMPadgett
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  3. #3
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reset AllowByPassKey property back to True (A2K/A2K2)

    The ShiftKey property can be set via a remote database.

    Go to the location below and download a Utility that will do what you need.

    ByPass Shift Key Utility

    HTH
    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

  4. #4
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Reset AllowByPassKey property back to True (A2K/A2K2)

    Here is some sample code you could use to reset AllowBypassKey property for another database:

    Public Sub SetDbBypass(strDbName As String, bAllowBypass As Boolean)
    On Error GoTo Err_Handler

    'bAllowBypass = True - allows use of Shift Bypass Key
    'bAllowBypass = False - prevents use of Shift Bypass Key

    Dim db As DAO.Database
    Dim ws As DAO.Workspace
    Dim prop As DAO.Property
    Dim strPropName As String
    Dim strMsg As String
    Dim bValue As Boolean

    Set ws = DBEngine.Workspaces(0)
    Set db = ws.OpenDatabase(strDbName)

    strPropName = "AllowBypassKey"
    db.Properties(strPropName) = bAllowBypass
    bValue = db.Properties("AllowBypassKey").Value
    strMsg = strPropName & " property = " & _
    bValue & vbCrLf & vbCrLf & _
    "External database:" & vbCrLf & strDbName
    MsgBox strMsg, vbInformation, "SHIFT BYPASS RESET"

    Exit_Sub:
    db.Close
    Set ws = Nothing
    Set db = Nothing
    Set prop = Nothing
    Exit Sub
    Err_Handler:
    If Err = 3270 Then 'Property not found - create and append
    Set prop = db.CreateProperty(strPropName, dbBoolean, bAllowBypass)
    db.Properties.Append prop
    Resume
    Else
    strMsg = "Error No " & Err.Number & ": " & Err.Description
    MsgBox strMsg, vbExclamation, "SET DATABASE BYPASS ERROR"
    End If

    End Sub

    Example of use (provide full path of other database):
    SetDbBypass "C:ACCESSNameOfDatabase.mdb", True

    NOTE: If the other database is secured, you won't be able to reset the AllowBypass property. By same token, if you are concerned someone can use code like this to bypass your own database's startup options, you need to implement user-level security, or at minimum set a database password.

    HTH

  5. #5
    New Lounger
    Join Date
    Nov 2001
    Location
    Virginia
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reset AllowByPassKey property back to True (A2K/A2K2)

    right, this is not a secured database.

    i am assuming this was his shortcut method of security; I am searching for the transparent command button that will reenable the bypass key.

    no, there is no phone; unless anyone knows Paul Doheny. they were going to move him to a cubicle from an office; he called in with family problems; needed a week; called in after a week and needed rwo more weeks; and they never saw him again. They think he did not want to move into the cubicle.

    thanks all for the ideas.

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Reset AllowByPassKey property back to True (A2K/A2K2)

    If it's not a secured database, an expedient may be to import all the objects into a new empty database - that will fix the issue with the bypass flag.
    Wendell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •