473,657 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change Shift key by another key to open file access

Alias90
23 New Member
Hi everybody!
As You know, we can open the design view in access by hold Shift key and Open. However, I want to prevent users open my file access in design view.
Please help me create function to change the Shift key by another key. Thanks for assistance!
Oct 9 '12 #1
13 8400
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
You can run this bit of code from any other access database:
Expand|Select|Wrap|Line Numbers
  1. Public Sub DisableShiftKeyBypass(strDB As String, bEnabled As Boolean)
  2.  
  3.    Const conPropNotFound = 3270
  4.  
  5.    On Error GoTo err_Handler
  6.  
  7.  
  8.    Dim db As DAO.Database
  9.    Set db = OpenDatabase(strDB)
  10.          db.Properties("AllowByPassKey") = bEnabled
  11.    db.Close
  12.    Set db = Nothing
  13.    Exit Sub
  14.  
  15. err_Handler:
  16.    If Err.Number = conPropNotFound Then
  17.       Dim prop As DAO.Property
  18.       Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, bEnabled)
  19.       db.Properties.Append prop
  20.       Resume Next
  21.    Else
  22.       MsgBox "Procedure [DisableShiftKeyBypass] was not succesfull" & vbNewLine & Err.Number & Err.Description
  23.    End If
  24.  
  25. End Sub
This will disable or enable the shift bypass key.

Note that it is just as easy for another user with the same or similar code to re-enable it. This is simply to prevent the average nosy user from getting to the backstage.

You can make access difficult to get too, but making it 100% secure is not possible. In most cases where access is used it also is not necessary.
Oct 9 '12 #2
Alias90
23 New Member
Thank for assitance !!
But i want to change Shift key by another key. just only the owner can open it. i tried on some functions disable Shift in internet.Howeve r, if users is good person in access , they stell can enable SHift by function .That reason I want to change the another key replace Shift key.Please help me. Thanks a lot of!!!!!
Oct 9 '12 #3
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
You cannot completely disable it, in such a way as it can't be re-enabled.

You can compile your code, and release it as a MDE/ACCDE, with keyboard shortcuts disabled, and navigation pane hidden, and the shift key disabled. You can add password protection to your modules, but access will never be 100% safe.
Oct 9 '12 #4
Seth Schrock
2,965 Recognized Expert Specialist
You can use Access Runtime for those users that don't need administrative access. This takes away all design ability (VBA, Shift+open, navigation pane, etc.). If you are running Access 2010, then Access Runtime 2010 is free. I use this all the time at work. I have one of the only Access licenses while all the users just have Runtime.
Oct 9 '12 #5
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
I haven't used runtime, but wouldn't that only work if they don't have a license for it?
Oct 9 '12 #6
Seth Schrock
2,965 Recognized Expert Specialist
I assume you mean a license for Access? What happens is that you package the database which creates an installation file with a .accdr extension which defaults to open with Runtime even if Access is installed. I'm not sure if Access can even open a .accdr file or not. The only issue with runtime is that all ribbon bar (Access 2007 & 2010) controls are gone. If you need certain abilities (copy, cut, paste, etc.) in the ribbon bar, they must be added manually.
Oct 9 '12 #7
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
As I said, no real experience with runtime but I believe I heard that you can simply rename the filetype accdb and you are back in business. That might just be my mind going though.
Oct 9 '12 #8
Seth Schrock
2,965 Recognized Expert Specialist
I just tested your theory and you are correct. Renaming it does get you past the security.
Oct 9 '12 #9
NeoPa
32,568 Recognized Expert Moderator MVP
Alias90:
But i want to change Shift key by another key. just only the owner can open it.
The Bypass Key (Shift) is inbuilt into the Access (and all Office) application. Unless you join the MS Access development team you won't be able to manage that.

If you disable the Bypass key for your project though, you could add some code to check for another key as the first code to run in the form that is set to open by default when the project is started. If the key is detected at that point then the code could stop and this would give a very similar result to the Bypass key.
Oct 12 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

13
2183
by: John Howard | last post by:
I have the following in a jythonc program to be executed in a html file. f1 = open("filename","r") I get message about filePermission read error. Program compiles and jar file is created. Just the html code gives message. Any ideas?
6
2058
by: Jakob Bieling | last post by:
Hi, I was wondering why there are file access modes, which you have to specify when opening the file. I am specifically talking about the 'read', 'read-write' and 'write' distinction. As far as I can tell, it only makes sure, you (the programmer) do not accidently write to it when you opened it for reading. To me, this seems like another one of those things that just make life harder. I am asking this, because I am writing a wrapper...
1
4505
by: N. Graves | last post by:
Help me please? I'm have users import tables from other Access Database in one of the process needed to use my ADB. To do this the user opens a form with a field for the file directory and another field for the Access database name. I would like to replace this with a Open file Dialog box. Could you please share with me the best way or the easiest way to accomplish this task. Thanks for you time!
6
2802
by: Cable | last post by:
Hello, I am hoping that someone can answer a question or two regarding file access. I have created an app that reads an image from a file then displays it (using OpenGL). It works well using fopen() with fgetc() to access each byte. I have decided to move further with this app and allow the user to select the first file of an image sequence and it will play the sequence back at at 24 frames per second. I have almost everything...
2
2089
by: Vinayak Raghuvamshi | last post by:
I have a file that has been created using shared read/write access. But C# code never is able to open this file for read and keeps throwing "...cannot open file as it is being used by another process...". I verified that the file is indeed available for shared reading. here is my code snippet. is there a bug in C# that i dont know, or is there a bug in my code? FileIOPermission perm = new FileIOPermission(PermissionState.None);
10
2126
by: vvenk | last post by:
Hello: When I tried to use an Access database, I get the following exception: Server Error in '/WebGrid' Application. -------------------------------------------------------------------------------- The Microsoft Jet database engine cannot open the file 'D:\Program Files\Infragistics\NetAdvantage 2005 Volume 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened exclusively
4
26811
by: CliffKing | last post by:
I am trying to use Windows Task Scheduler to run a batch file for an already open MS Access database. Below is the syntax to the batch file: Batch file: DailySalesExport.bat REM This runs the macro that exports the reports to the J drive PATH = "C:\Program Files\Microsoft Office\Office\;C:\Windows\Command" START /WAIT Msaccess.exe "D:\acesdata\SALES\Daily2005.mdb" /x "SnapShotExportDailySales" EXIT
1
19919
by: ABCL | last post by:
Hi All, I am working on the situation where 2 different Process/Application(.net) tries to open file at the same time....Or one process is updating the file and another process tries to access it, it throws an exception. How to solave this problem? So second process can wait until first process completes its processing on the file. Thanks in advance
5
11206
by: Ryan Liu | last post by:
Hi, Both way works, I'd just ask some experts which way is better? My application creates a log file daily. Now each time when I write a log, I will open the file and append to the end. Ocz, if the file is not exist(e.g. another day), it will creates the file first.
4
7877
by: Wayne | last post by:
How do I get rid of the generic Windows "Open File - Security Warning" that appears when I try to open a database that resides on another PC on my home network? This is not the annoying macro security warning - I have my macro security set to low. The warning I am describing only appears when a database on another machine is opened.
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.