|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
can't disable shift key with faq_DisableShiftKeyBypass functionhello,
I use the function "faq_DisableShiftKeyBypass " described in "SECFAQ.doc" by Microsoft. I am logged in as database owner (also a memer of Admins group), have full permissions. Database is secured, database name isn't misspelled when calling the function, path to database is correct. When calling the function I get the error message "Function DisableShiftKeyBypass did not complete successfully", which means the property was not created. However, when I use the function to disable a different (also secured) database it works as it should. What might be the problem? Thank you for hints. That function fails if the db is already opened exclusively or if you're not
joined to the secure workgroup when running the function. I'd suggest stepping through the function in the debug window to see which line of code fails and sends you to the error handler. Chris jaworski_m wrote: Show quoteHide quote >hello, >I use the function "faq_DisableShiftKeyBypass " described in "SECFAQ.doc" by >Microsoft. > >I am logged in as database owner (also a memer of Admins group), have full >permissions. Database is secured, database name isn't misspelled when calling >the function, path to database is correct. > >When calling the function I get the error message "Function >DisableShiftKeyBypass did not complete successfully", which means the >property was not created. > >However, when I use the function to disable a different (also secured) >database it works as it should. > >What might be the problem? > >Thank you for hints. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-security/200901/1 Chris, thank you for reply.
I posted the code of the "faq_DisableShiftKeyBypass" (below) for reference of discussion. > That function fails ... if you're not joined to the secure workgroup when running I executed the function from inside the secured database just to make sure > the function. if I am connected to the correct workgroup. It didn't work. > I'd suggest stepping through the function in the debug window to see which line of > code fails and sends you to the error handler. I did according to your suggestions. The error is triggered in the line marked <BREAKPOINT> (code below) > That function fails if the db is already opened exclusively. After your suggestions I tried opening the database exclusively. Function WORKED. Running the "faq_DisableShiftKeyBypass" function from SEPARATE *ShiftByPass.mdb* file (containing module with the function) WORKED ONLY when this separate file was also opened exclusively. Correct me if I'm wrong. Does this function execute ONLY when a database is opened exclusively? **** CODE START (faq_DisableShiftKeyBypass) **** Function faq_DisableShiftKeyBypass(strDBName As String, fAllow As Boolean) As Boolean On Error GoTo errDisableShift Dim ws As Workspace Dim db As Database Dim prop As Property Const conPropNotFound = 3270 Set ws = DBEngine.Workspaces(0) <BREAKPOINT> Set db = ws.OpenDatabase(strDBName) db.Properties("AllowByPassKey") = Not fAllow faq_DisableShiftKeyBypass = fAllow exitDisableShift: Exit Function errDisableShift: 'The AllowBypassKey property is a user-defined ' property of the database that must be created ' before it can be set. This error code will execute ' the first time this function is run in a database. If Err = conPropNotFound Then ' You must set the fourth DDL parameter to True ' to ensure that only administrators ' can modify it later. If it was created wrongly, then ' delete it and re-create it correctly. Set prop = db.CreateProperty("AllowByPassKey", _ dbBoolean, False, True) db.Properties.Append prop Resume Else MsgBox "Function DisableShiftKeyBypass did not complete successfully." faq_DisableShiftKeyBypass = False GoTo exitDisableShift End If End Function **** CODE END **** The function works for me when I already have the target db opened in shared
mode. Something about your target db file is requiring you to open it exclusively when you open it with the opendatabase method. Hard to pin down what though. I'd suggest opening the db in exclusive mode to change its shiftkeybypass property. At least you know that works for this db. Chris jaworski_m wrote: Show quoteHide quote >I posted the code of the "faq_DisableShiftKeyBypass" (below) for reference >of discussion. > >> That function fails ... if you're not joined to the secure workgroup when running >> the function. >I executed the function from inside the secured database just to make sure >if I am connected to the correct workgroup. It didn't work. > >> I'd suggest stepping through the function in the debug window to see which line of > code fails and sends you to the error handler. >I did according to your suggestions. The error is triggered in the line >marked <BREAKPOINT> (code below) > >> That function fails if the db is already opened exclusively. >After your suggestions I tried opening the database exclusively. Function >WORKED. >Running the "faq_DisableShiftKeyBypass" function from SEPARATE >*ShiftByPass.mdb* file (containing module with the function) WORKED ONLY when >this separate file was also opened exclusively. > >Correct me if I'm wrong. Does this function execute ONLY when a database is >opened exclusively?
CreateWorkspace does not work for me
Capture NT username Help with Splitting and Security Issues ACCDE I'm drawing a blank... Forgotten password and reloading Access RWOP and passing variables to a function fastest way of distributing a split and secured database Using logon name and password within a form firewall |
|||||||||||||||||||||||