Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 12th, 2003, 11:18 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default prevention of edit forms/tables

hi

how do i prevent user from entering into the 'design view', 'datasheet view' of my form??? how can i prevent them for entering to the database window (where you can choose to create table in design view or wizard.)??

pls advice
nono



Reply With Quote
  #2 (permalink)  
Old November 13th, 2003, 04:52 AM
Friend of Wrox
Points: 422, Level: 7
Points: 422, Level: 7 Points: 422, Level: 7 Points: 422, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: La Jolla, CA, USA.
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First, make a backup of your database! Have you done that yet? Good.

Now, take a look at Tools|Startup menu. There is a checkbox that says "Display Database Window". This dialog controls the menus, menu items, etc. that your user will see when the database first starts up... You can play around with the various settings, but be forewarned that some people have locked themselves out of their own database playing with these settings. Which is why I strongly recommend to make a backup before "playing" with the settings.

One catch: Your user, if sophisticated enough, can bypass your startup settings by holding down the shift key when first opening your database. This will also bypass any autoexec code.

Solution: You have to set the "AllowBypassKey" property to false and add it to the database properties collection. This can only be done via VBA code.

If you're interested in digging deeper... reply appropriately.

Reply With Quote
  #3 (permalink)  
Old November 13th, 2003, 08:53 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

The Man from UNCLE (insert secret agent music here ) answered the second part of your question. Here's the first part.

After you make your back-up (hint, hint) you click on TOOLS > DATABASE UTILITIES > MAKE MDE FILE. This will turn your MDB into an MDE. An MDE is (sort of) an executable-only version of your database. Access will not let you make an EXE file, but the MDE is close. The MDE will not let you edit or manipulate form designs, etc; and it strips the VBA code out of the database so it's not even visible to the user. Together with UNCLE's (not so secret) advice, this, and then creating custom toolbars, you can keep people out of your database's underwear (so to speak). :D


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #4 (permalink)  
Old November 13th, 2003, 10:41 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since you made a backup. I should not have to say that again.
Now, make sure that you do not lock yourself out of your own database by creating a new toolbar. I have had wo many folks ask me to crack their database open because they locked themselves out by creating a new toolbar and setting it as default.




Sal
Reply With Quote
  #5 (permalink)  
Old November 13th, 2003, 10:09 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi U.N.C.L.E.,

i have heard alot of people saying abt the shift key, could u tell me how can the shift key be used to bypass the autoexec function????

and of course could u guide me on the VBA coding. thanks!

pls advice
nono

Reply With Quote
  #6 (permalink)  
Old November 13th, 2003, 11:45 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

creating mde file is a good one. i have another question that pops up on my mind when trying the methods..

this database are meant for normal users (those who have no access to coding/tables etc) and admin (those who have access to the tables coding and everything).

i have put in the method u all have taught me. but if in any point of time that i (admin) wish to make some changes to my database so how can i be able to do that??? as i have the access to the tables/coding in my backup database, i can't change from there as that will not be the same as the one where users have make some modification of the datas. so how can i make changes (coding/tables format etc) on the database (the one user is using) that i have disable the 'database window'???

pls advice
nono
Reply With Quote
  #7 (permalink)  
Old November 14th, 2003, 07:29 AM
Friend of Wrox
Points: 422, Level: 7
Points: 422, Level: 7 Points: 422, Level: 7 Points: 422, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: La Jolla, CA, USA.
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You might want to think about creating a FE/BE model. The front end (FE) as the user interface which can be an .MDE format, and the back end (BE) database in one central location which will be your data container.

As for code examples... Direct from MS...
Please take a look as this MS web document (search for AllowBypassKey):

http://support.microsoft.com/default...ent/secfaq.asp

Good Luck!

P.S. Be sure to back up database before running your AllowBypassKey code!



Reply With Quote
  #8 (permalink)  
Old November 14th, 2003, 09:02 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

The Man from UNCLE's advice is good... put the tables and queries in an MDB file and put the forms and reports in an MDE and link them.

You can password protect the MDB half with the tables so that users cannot edit them. They will only able to affect the data via the forms in the MDE. The MDE half will be only available in a limted way so they cannot do damage.

Remember to keep an MDB version of the forms and reports so you can upgrade them at a later time. When you upgrade them, turn them into an MDE again and give that to the users again.

Just remember, keep-back ups of everything unprotected with no passwords, etc. somewhere where only you can get at it so if you accidentally get locked out you have the source information.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #9 (permalink)  
Old November 16th, 2003, 10:47 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

i have try the method ... regarding the "AllowBypassKey"

but how do i use the special keys (eg.shift key) to open the database???

pls guide me.
nono

Reply With Quote
  #10 (permalink)  
Old November 16th, 2003, 11:38 PM
Authorized User
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Go back to your MDB version of "forms and reports" database to make changes.



Vladimir
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Forms with Master/Multiple SubForms natwong Access 1 February 27th, 2007 01:01 PM
Forms and tables in Access 2003 marclf Access VBA 2 October 24th, 2006 07:10 AM
Hiding Tables/Forms Paula222 Access VBA 1 April 17th, 2006 02:59 PM
2 tables, 1 query, 1 form, cannot edit :( tanjuakio Access 2 June 24th, 2005 06:24 AM
SQL Injections Prevention phungleon Classic ASP Databases 1 April 8th, 2005 12:23 PM



All times are GMT -4. The time now is 09:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.