Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim db As Database
strDB = "C:\Data\Tek-Tips.mdb"
Set db = OpenDatabase(strDB, True)
On Error Resume Next
db.Properties("AllowBypassKey") = True
If Err.Number > 0 Then
' Create the new property.
Set prp = dbs.CreateProperty("AllowBypassKey", dbBoolean, True)
dbs.Properties.Append prp
End If
Private Sub cmdFEINI_Click()
Dim strDB As String
Dim db As Database
Dim prp As Property
strDB = "H:\myDirectory\myFolder\myDatabase.mde"
Set db = OpenDatabase(strDB, True)
On Error Resume Next
db.Properties("AllowBypassKey") = True
If Err.Number > 0 Then
' Create the new property.
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True)
db.Properties.Append prp
End If
End Sub
Private Sub cmdFEINI_Click()
Dim WS as Workspace
Dim strDB As String
Dim db As Database
Dim prp As Property
Set WS = Workspaces(0) ' Current workspace
strDB = "H:\myDirectory\myFolder\myDatabase.mde"
Set db = WS.OpenDatabase(strDB, True) 'Hopefully retains security
On Error Resume Next
db.Properties("AllowBypassKey") = True
If Err.Number > 0 Then
' Create the new property.
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True)
db.Properties.Append prp
End If
End Sub
Function NoByPass()
Dim varResult As Variant
varResult = AllowBypassKeyFalse
If varResult = True Then
MsgBox "Bypass startup key will now be disregarded."
Else
MsgBox "Unable to disable bypass startup key."
End If
End Function
Function AllowBypassKeyFalse() As Integer
Dim dbs As Database, prp As Property
Dim strPropName As String
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
strPropName = "AllowBypassKey"
On Error GoTo AllowBypassKeyFalse_Err
dbs.Properties(strPropName) = False
AllowBypassKeyFalse = True
AllowBypassKeyFalse_Exit:
Exit Function
AllowBypassKeyFalse_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, dbBoolean, False)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
AllowBypassKeyFalse = False
Resume AllowBypassKeyFalse_Exit
End If
End Function
I could, of course, made the mde file and save it somewhere else, then lock it, then move it, but I'd prefer to skip the other steps at the risk of the unlikely possibility that someone could get the update after I drop it on the server but before I lock the bypass.
Private Sub cmdFEINI_Click()
'Requires DAO library reference;
'In module select References from tools menu
'and check Microsoft DAO 3.6 Object Library
Dim strDB As String
Dim db As DAO.Database 'Note DAO library reference
Dim prp As Property
strDB = "H:\myDirectory\myFolder\myDatabase.mde"
Set db = OpenDatabase(strDB, True)
'On Error Resume Next
db.Properties("AllowBypassKey") = True
If Err.Number > 0 Then
' Create the new property.
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True)
db.Properties.Append prp
End If
End Sub
Function NoByPass(strDbPathFilename as String)
Dim varResult As Variant
varResult = AllowBypassKeyFalse (strDbPathFilename)
If varResult = True Then
MsgBox "Bypass startup key will now be disregarded."
Else
MsgBox "Unable to disable bypass startup key."
End If
End Function
Function AllowBypassKeyFalse(strDbPathFilename as String) As Integer
Dim dbs As Database, prp As Property
Dim strPropName As String
Const conPropNotFoundError = 3270
Set dbs = Opendatabase(strDbPathFilename) 'Replaced Currentdb
strPropName = "AllowBypassKey"
On Error GoTo AllowBypassKeyFalse_Err
dbs.Properties(strPropName) = False
AllowBypassKeyFalse = True
AllowBypassKeyFalse_Exit:
Exit Function
AllowBypassKeyFalse_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, dbBoolean, False)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
AllowBypassKeyFalse = False
Resume AllowBypassKeyFalse_Exit
End If
End Function