473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Hiding Design View from users

21
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!
Jul 21 '10 #1
7 15840
NeoPa
32,556 Expert Mod 16PB
Both use the Tools menu.
  1. Startup...
    This enables you to control use of Access Special Keys (of which Shift at startup is one).
  2. 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.
Jul 21 '10 #2
munkee
374 256MB
@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:

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Public Function SetProperties(strPropName As String, _
  5. varPropType As Variant, varPropValue As Variant) As Integer
  6.  
  7.     On Error GoTo Err_SetProperties
  8.  
  9.     Dim db As DAO.Database, prp As DAO.Property
  10.  
  11.     Set db = CurrentDb
  12.     db.Properties(strPropName) = varPropValue
  13.     SetProperties = True
  14.     Set db = Nothing
  15.  
  16. Exit_SetProperties:
  17.     Exit Function
  18.  
  19. Err_SetProperties:
  20.     If Err = 3270 Then    'Property not found
  21.         Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
  22.         db.Properties.Append prp
  23.         Resume Next
  24.     Else
  25.         SetProperties = False
  26.         MsgBox "SetProperties", Err.Number, Err.Description
  27.         Resume Exit_SetProperties
  28.     End If
  29. 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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnbypass_Click()
  2.  On Error GoTo Err_bDisableBypassKey_Click
  3.     'This ensures the user is the programmer needing to disable the Bypass Key
  4.     Dim strInput As String
  5.     Dim strMsg As String
  6.     Beep
  7.     strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
  8.              "Please key the programmer's password to enable the Bypass Key."
  9.     strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
  10.     If strInput = "PASSWORDHERE" Then
  11.         SetProperties "AllowBypassKey", dbBoolean, True
  12.         Beep
  13.         MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
  14.                "The Shift key will allow the users to bypass the startup options the next time the database is opened.", _
  15.                vbInformation, "Set Startup Properties"
  16.     Else
  17.         Beep
  18.         SetProperties "AllowBypassKey", dbBoolean, False
  19.         MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
  20.                "The Bypass Key was disabled." & vbCrLf & vbLf & _
  21.                "The Shift key will NOT allow the users to bypass the startup options the next time the database is opened.", _
  22.                vbCritical, "Invalid Password"
  23.         Exit Sub
  24.     End If
  25. Exit_bDisableBypassKey_Click:
  26.     Exit Sub
  27. Err_bDisableBypassKey_Click:
  28.     MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
  29.     Resume Exit_bDisableBypassKey_Click
  30. 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.
Jul 21 '10 #3
patjones
931 Expert 512MB
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
Jul 21 '10 #4
dileshw
21
I tried the acode above..But i get a runtime-error (3270)...
aparentlythe bug is in this this line.
Expand|Select|Wrap|Line Numbers
  1.     db.Properties(strPropName) = varPropValue
  2.  
Jul 30 '10 #5
patjones
931 Expert 512MB
I tried the code out and it works fine for me. Maybe you could try creating the property before using it. First do this:

Expand|Select|Wrap|Line Numbers
  1. Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
  2. db.Properties.Append prp

Then do this:

Expand|Select|Wrap|Line Numbers
  1. Set db = CurrentDb
  2. db.Properties(strPropName) = varPropValue
  3. SetProperties = True
  4. 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
Jul 30 '10 #6
Hi Pat

Is there any way to set the strInput Input Mask of the msg box to be password??
Dec 1 '10 #7
patjones
931 Expert 512MB
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
Dec 1 '10 #8

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

Similar topics

5
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?...
6
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...
5
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...
2
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. ...
3
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...
2
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...
1
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
3
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...
27
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: ...
3
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...
0
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
0
BarryA
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...
1
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...
0
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...
0
marktang
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,...
0
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...
0
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...
0
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,...
0
isladogs
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...

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.