PC Review


Reply
Thread Tools Rate Thread

can't disable shift key with faq_DisableShiftKeyBypass function

 
 
jaworski_m
Guest
Posts: n/a
 
      4th Jan 2009
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.

 
Reply With Quote
 
 
 
 
jaworski_m
Guest
Posts: n/a
 
      4th Jan 2009
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
> 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?

**** 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 ****
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SHift Key disable (again..) NWO Microsoft Access 3 17th Sep 2009 01:40 AM
Function to disable/enable the shift bypass key John Baker Microsoft Access Form Coding 2 17th Jan 2007 01:40 PM
Disable shift key =?Utf-8?B?RnlzaA==?= Microsoft Access Security 3 12th Nov 2004 02:03 PM
Disable shift key Sunny Microsoft Access Getting Started 2 2nd Sep 2004 11:10 PM
Re: faq_DisableShiftKeyBypass Douglas J. Steele Microsoft Access Security 2 28th Sep 2003 01:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:19 PM.