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.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » 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
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.
HTH
RDH
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
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.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications