Hi,
I am making a database amd i dont want users seeing the stuff thats happening in the background. So i would like to hide everything so that ONLY I can see it. Doing some reading online (and asking friends) I learnt of a few things i can do:
1- right now i have hidden the design view using tools->startup (and unchecking all boxes). But if someone knows a bit of access they can get into the design view by using SHIFT+open. I read online that you can disable the SHIFT-overide. Sadly the code i found for the same didnt work. Can someone tell me how I can do this?
2- Create an application out of the DB so that its not modifuable (structure-wise). I have not seen this done, and its pure hear-say.
Can someone help me out on this please. Thanks!
7 15840 NeoPa 32,556
Expert Mod 16PB
Both use the Tools menu. - Startup...
This enables you to control use of Access Special Keys (of which Shift at startup is one). - Database Utilities...
This gives an option to create MDE file. This works up to version 2003. I expect something similar is available in later releases.
@dileshw
I use the following code which I found a few months ago now (I honestly can't remember where I found it but thank you to the writer) to stop users getting access via holding down SHIFT as the database loads:
Place the following in a module: - Option Compare Database
-
Option Explicit
-
-
Public Function SetProperties(strPropName As String, _
-
varPropType As Variant, varPropValue As Variant) As Integer
-
-
On Error GoTo Err_SetProperties
-
-
Dim db As DAO.Database, prp As DAO.Property
-
-
Set db = CurrentDb
-
db.Properties(strPropName) = varPropValue
-
SetProperties = True
-
Set db = Nothing
-
-
Exit_SetProperties:
-
Exit Function
-
-
Err_SetProperties:
-
If Err = 3270 Then 'Property not found
-
Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
-
db.Properties.Append prp
-
Resume Next
-
Else
-
SetProperties = False
-
MsgBox "SetProperties", Err.Number, Err.Description
-
Resume Exit_SetProperties
-
End If
-
End Function
Create a form which loads on startup or use an existing form which you have that loads on startup, for me this is usually the user login form on my custom system.
Place a button on the form with the following code behind it: - Private Sub btnbypass_Click()
-
On Error GoTo Err_bDisableBypassKey_Click
-
'This ensures the user is the programmer needing to disable the Bypass Key
-
Dim strInput As String
-
Dim strMsg As String
-
Beep
-
strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
-
"Please key the programmer's password to enable the Bypass Key."
-
strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
-
If strInput = "PASSWORDHERE" Then
-
SetProperties "AllowBypassKey", dbBoolean, True
-
Beep
-
MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
-
"The Shift key will allow the users to bypass the startup options the next time the database is opened.", _
-
vbInformation, "Set Startup Properties"
-
Else
-
Beep
-
SetProperties "AllowBypassKey", dbBoolean, False
-
MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
-
"The Bypass Key was disabled." & vbCrLf & vbLf & _
-
"The Shift key will NOT allow the users to bypass the startup options the next time the database is opened.", _
-
vbCritical, "Invalid Password"
-
Exit Sub
-
End If
-
Exit_bDisableBypassKey_Click:
-
Exit Sub
-
Err_bDisableBypassKey_Click:
-
MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
-
Resume Exit_bDisableBypassKey_Click
-
End Sub
Where I have use the bold/italics type in a password. This will be used to enable/disable the shift key if you wish to be able to use it during your testing.
Now go back to your form and set the button to transparent. This way when the form loads only you will know where it is. When you click the area it will load up a dialog for you to enter the password you created above. This will then disable the shift key.
The shift key will remain disabled for the file until you put the password back in to enable it.
Any questions let me know.
If you are using Access 2007, go to the Database Tools tab and note the "Make ACCDE" option. This will produce a locked copy of the database for you, although you might still need to follow the advice of others here in order to disable the SHIFT button on start-up.
Pat
I tried the acode above..But i get a runtime-error (3270)...
aparentlythe bug is in this this line. -
db.Properties(strPropName) = varPropValue
-
I tried the code out and it works fine for me. Maybe you could try creating the property before using it. First do this: - Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
-
db.Properties.Append prp
Then do this: - Set db = CurrentDb
-
db.Properties(strPropName) = varPropValue
-
SetProperties = True
-
Set db = Nothing
If that fails, perhaps you can post the code as you have it just in case you made an error in pasting it into your VBA module
Pat
Hi Pat
Is there any way to set the strInput Input Mask of the msg box to be password??
Hi Patrick,
If you are referring to setting the input mask for an input box to be a password mask, yes it appears to be possible. I found one way to do this on another forum, which you can see here. This process involves some Windows system calls and might be more trouble than it's worth.
The simpler route would be for you to create a small modal form with a text box, and set the text box input mask to "Password". It will add very little code to your project and probably be just as quick as implementing the input box solution.
Pat
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Simone |
last post by:
Hello All.
I would like some advice.
What is the best way to make an Access database design not accessible?
Like accessing tables, form design and etc.
Is it a good idea to make a MDE file?...
|
by: NB |
last post by:
Hi
Is there any way to call up the query design view from code?
In my compiled-as-MDE app everything is hidden from end users.
However, I want advanced user to have access to the query design...
|
by: David Deacon |
last post by:
Hi i was given the following advise,below my OriginalQuestion
I am a little new to ADOX can you direct me to the following
Do i place the code behind a button on a form?
Or do i place it in the...
|
by: Ray |
last post by:
Stop me if you've heard this, but I am running Access 2002 and all of
a sudden, if I design a particular form (it's been working fine for
ages), Access crashes rather than open it in design view.
...
|
by: sea |
last post by:
If a runtime installation of Access is created and installed on a
client machine that has a full verion of access, will it still be
possible to view the tables and queries in design view but not...
|
by: Nathan Sokalski |
last post by:
I have an HTML table in which I am using ASP:Panel controls to group
together <tr>'s so that I can more easily show/hide them (by setting the
ASP:Panel's Visible property). This works fine, but...
|
by: Farhaad Faaique |
last post by:
Dears,
how can i enable a from's design view when it is disabled? (the
database doesn't have any passwords to be accessed but it has password
for vba codes).
thanks in advance,
Farhaad
|
by: Jeff Couch - Academy Roofing |
last post by:
In my office everyone has access to a database. All the computers/
users work well with it. One computer, no matter who is signed in,
defaults to design view when opening any database. We don't...
|
by: matt |
last post by:
Hello group,
I'm trying to become familiar with the information hiding design rules, and I
have a lot (3) of questions for all you experts. AFAIK, a generic module has 2
files:
...
|
by: MLH |
last post by:
An A97 application that sometimes stays open for days
at a time may have a form, report, table or query open
in design view. What's the simplest code snippet that
would determine whether any...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |