PC Review


Reply
Thread Tools Rate Thread

How can I prevent user from adding table

 
 
Patrick
Guest
Posts: n/a
 
      14th Apr 2009
I know how to give/take away user permission for tables, queries, forms,
reports and macros, but how do I prevent user from adding new table(s) to
database. Any suggestion would be greatly apprieciated.
 
Reply With Quote
 
 
 
 
Patrick
Guest
Posts: n/a
 
      15th Apr 2009
Hi Chris,
Thank you for your help, but this is too good it lock out user from opening
database with run-time error '3033':
You do not have the necessary permissions to use the 'Tables' object. Have
your system adminstrator or .....establish the appropriate permissions for
you.

but if I comment out the line below it let user open database with no
permission to create new tables and query.
con.Permissions = con.Permissions And Not DB_SEC_CREATE

How can I allow user to create queries but not table? Thanks again for your
help.





"Chris O'C via AccessMonster.com" wrote:

> Run the vba code listed in the security faq to prevent users from creating
> new tables and queries. Do it for both the default admin user and the users
> group. Run the code when logged in as the db owner.
>
> Public Function revokePermOnNewObj()
> Call noNewObjects("Admin")
> Call noNewObjects("Users")
> End Function
>
>
> Public Function noNewObjects(strUser As String)
> Dim db As Database
> Dim con As Container
>
> Set db = CurrentDb
> Set con = db.Containers("Tables")
> con.UserName = strUser
> con.Permissions = con.Permissions And Not DB_SEC_CREATE
>
> Set con = Nothing
> Set db = Nothing
> End Function
>
> If you haven't read the security faq yet, download and *study* it.
>
> http://support.microsoft.com/?id=207793
>
> Chris
>
>
> Patrick wrote:
> >I know how to give/take away user permission for tables, queries, forms,
> >reports and macros, but how do I prevent user from adding new table(s) to
> >database. Any suggestion would be greatly apprieciated.

>
> --
> Message posted via http://www.accessmonster.com
>
>

 
Reply With Quote
 
Patrick
Guest
Posts: n/a
 
      16th Apr 2009
Got it, I gave Users open/run database permissions and it works. Regarding to
not being able to let user create queries because of Access security, I think
it's ok cause I only need to use the codes you provide with some of the
databases but not all. Thanks for your help, I really appreciated it.


"Chris O'C via AccessMonster.com" wrote:

> The code I gave you doesn't remove open/run database permissions from users.
> Something else is affecting that. Check that you copy/pasted the code
> exactly, with no modifications.
>
> If a user can open a db without permissions, the db isn't secured in the
> first place.
>
> Do you have an object named "tables"? Besides the tables container, I mean.
>
> "How can I allow user to create queries but not table?"
>
> You can't with Access security. You can upsize the tables to SQL Server and
> inside SQL Server allow only certain users to create tables. The users would
> be free to create queries inside Access, providing you don't run the code I
> gave you to prevent table and query creation.
>
> Chris
>
>
> Patrick wrote:
>
> >Thank you for your help, but this is too good it lock out user from opening
> >database with run-time error '3033':
> > You do not have the necessary permissions to use the 'Tables' object. Have
> >your system adminstrator or .....establish the appropriate permissions for
> >you.
> >
> >but if I comment out the line below it let user open database with no
> >permission to create new tables and query.
> >con.Permissions = con.Permissions And Not DB_SEC_CREATE
> >
> >How can I allow user to create queries but not table? Thanks again for your
> >help.

>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...urity/200904/1
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
prevent a user from adding any sheet in a workbook Subodh Microsoft Excel Programming 2 7th Apr 2010 02:55 AM
prevent sysprep from adding a new user black_13 Windows Vista General Discussion 0 16th Sep 2008 08:14 PM
prevent user from adding schedule task =?Utf-8?B?RGF2aWQ=?= Windows XP General 3 15th Aug 2006 02:44 PM
prevent user from adding a new record to a datagrid/dataset Maria Anthonsen Microsoft VB .NET 5 10th Dec 2004 04:13 PM
Prevent user from adding PC to a domain Stephen Stormont Microsoft Windows 2000 Networking 5 14th Apr 2004 02:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 AM.