Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SHIFT Bypass Key for Security seems to do nothing in XP

Status
Not open for further replies.

bblekfeld

Programmer
Mar 9, 2004
49
US
Hi,

I have a database secured by the SHIFT BYPASS methods described in the following post thread181-785175

Unfortunatly, on a PC that is set up with Windows 98 and Access 2000 the SHIFT BYPASS thing works, but if I try to open the DB on my Windows XP Access 2003 machine, the database opens unbypassed.

Is anyone aware of changes that have been made in XP and Access that I need to account for in code?

Thanks for any help!
 
The shift bypass method that you used is DAO method. I would check whether Access 2003 still have DAO 3.6 for you to select in your references. If No, that tells you why all your DAO methods won't work!

Then your option would be re-writing you shift bypass module. I've been use this one from the MS Access help file

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

Caution: This disable bypass key CAN NOT be reversed unless you write a reverse code to enable it. You'll be forever lock. Never use on your master copy.
 
below is actually the code I am using. I checked and the DAO property is there and checked.


Option Compare Database

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant)
'enables/disables database property such as shift-lock key
Dim dbs As DAO.Database, prp As DAO.Property
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
Function SetStartupProperties()
'Disallows Shift Key privilege of bypassing startup procedures.
ChangeProperty "AllowBypassKey", dbBoolean, False
MsgBox "Shift Security Overide has been deactivated"
End Function
Public Function STD_OUTPUT_TO()
'menubar for output to ... dialog
On Error GoTo STD_OUTPUT_TO_Err
DoCmd.OutputTo acReport, "", "", "", False, ""
STD_OUTPUT_TO_Exit:
Exit Function
STD_OUTPUT_TO_Err:
'MsgBox Error$
Resume STD_OUTPUT_TO_Exit
End Function
Public Function print_dot_dot_dot()
'menu item for print...
On Error Resume Next
DoCmd.RunCommand acCmdPrint
End Function
Function UnDoShiftLock(Optional pw As String) As Integer
're -enables Shift Key privilege of bypassing startup procedures, if correct password entered.
Static Try As Integer
Dim PSW As String, PswOK As Integer
On Error Resume Next
PswOK = False
If Len(pw & "") = 0 Then
PSW = Trim(LCase(InputBox("Enter Password", "Password") & ""))
Else
PSW = Trim(LCase(pw))
End If
If PSW = "MYPASSWORD" Then
PswOK = True 'put your password here
MsgBox ("Shift Key Security Overide Complete - Please close the database and reopen holding the shift key to access back end.")
End If
If PSW = "suite950" Then
PswOK = True 'or here -- use lower case
MsgBox ("Shift Key Security Overide Complete - Please close the database and reopen holding the shift key to access back end.")
End If
Try = Try + 1
If Try > 4 Then DoCmd.Quit acQuitSaveAll '4 strikes and you are out
If Not PswOK Then
MsgBox "Invalid Password, Attempt: " & Try
UnDoShiftLock = False
Exit Function
End If
'call function to enable shiftlock
ChangeProperty "AllowBypassKey", dbBoolean, True
UnDoShiftLock = True

End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top