Wednesday 23 January 2008

Enabling shift key in MsAccess




Enabling shift key in MsAccess ?


By : Saif Ikram

Published on : 23-January-2008




Microsoft Office Access, previously known as Microsoft Access, is a relational database management system from Microsoft which combines the relational Microsoft Jet Database Engine with a graphical user interface and software development tools. It is a member of the 2007 Microsoft Office system.


Access can use data stored in Access/Jet, Microsoft SQL Server, Oracle, or any ODBC-compliant data container. Skilled software developers and data architects use it to develop application software. Relatively unskilled programmers and non-programmer "power users" can use it to build simple applications. It supports some object-oriented techniques but falls short of being a fully object-oriented development tool.


Applications developed Ms-access are secure in some aspects when the shift key is disabled.
But once disabled cannot be recovered, which means developer cannot access the source code or cannot make any changes.


To avoid this, application should itself provide an option to enable the shift key at least for an administrator.


The following code snippet helps you to enable/disable shift

 Sub EnableShiftKey()

Dim db As DAO.Database
Dim prp As DAO.Property

Set db = CurrentDb
db.Properties.Delete "AllowBypassKey"
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True, True)
db.Properties.Append prp

db.Properties.Refresh

Set prp = Nothing
Set db = Nothing

End Sub

Just change the value from True to False to disable shift button