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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable SHIFT works, but if DB is 'End Tasked' then it doesn't!

Status
Not open for further replies.

LeanneGodney

Technical User
Mar 7, 2002
175
GB
Hi there,

I have got my adp database working perfectly with the AllowBypassKey property. I have a main form that opens automatically, and when it closes it sets the property to false for when the user next opens the db.

Here's the problem though. If the db is taking a little longer to open you can End-Task it. And when you open it up the next time you can use the SHIFT to bypass...

Obviously, this really sucks as it's a huge hole in security... Does anyone know how to set the AllowBypassKey as a permanent fixture so you don't have to set it each time??

Any help would be most appreciated.

Thanks,
Leanne
 
I may not understand. But I think if you set the properties once, then it should stay with the application. This is how I do it
Code:
Option Compare Database
Option Explicit
Function ChangeProperty(strPropName As String, _
 varPropType As Variant, varPropValue As Variant) As Integer
' The current listing in Access help file which will
' let anyone who can open the db delete/reset any
' property created by using this function, since
' the call to CreateProperty doesn't use the DDL
' argument

 Dim dbs As DAO.Database
 Dim 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

Public Sub subSetAdminProperties()
   ChangeProperty "AllowBypassKey", dbBoolean, False
   ChangeProperty "AllowFullMenus", dbBoolean, True
   ChangeProperty "AllowSpecialKeys", dbBoolean, True
   ChangeProperty "AllowBreakIntoCode", dbBoolean, True
End Sub

Public Sub subSetUserProperties()
   ChangeProperty "AllowBypassKey", dbBoolean, False
   ChangeProperty "AllowFullMenus", dbBoolean, False
   ChangeProperty "AllowSpecialKeys", dbBoolean, False
   ChangeProperty "AllowBreakIntoCode", dbBoolean, False
   ChangeProperty "StartupShowDBWindow", dbBoolean, False
   ChangeProperty "", dbBoolean, False
End Sub
If I make a version for the users I run the user properties.
 
Hi there,

That doesn't appear to be true... I set the bypass to false once and then opened and closed it a couple of times trying to use SHIFT, and on the fourth try it let me bypass...

Any ideas?

Leanne
 
I did not notice that you are working with an adp, I do not have much experience there but I would not think it makes a difference. I have never seen this with an mdb. Could you run the set properties when you close the database, to reset the property?
 
Oops, I see that you are doing that already.
 
Yeah, have tried to do that, but if the database starts openign up and the user end-task's it then it doesn't have a chance to open the form that has the code to set it for the next time. This is my problem...
 
I tried to do what you said, but I could not break in. I clicked on the application then hit "end task", and did it a couple times. I still could not bypass. I do not set the properties every time either. I am reaching, but here is some ideas. Set the properties once, and then remark out the code so it does not try to reset the properties every time. Maybe it hangs up in the code so when you end task the code for setting the properties is not finished executing. Also make sure your code is compiled.
You may need to implement some real security if this is a concern. You may have found a way around the "allow by pass" property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top