changing table group permisiions in VBA

jonnydexter

Registered User.
Local time
Today, 20:24
Joined
Aug 31, 2012
Messages
21
Hello

Is it possible for me to change the group permissions from within VBA ?

For example. If i add or import a new table into the database rather than use the security settings in access to change the group/user permissions, can i code it onto a form for editing from there ?

I can list all the tables using the tabledef but the only permissions i can find for the doc are related to the currently logged in users access rights.
Ideally i would like to be able to see which groups exist within the database security setup and assign permissions to the table from these.

hope this makes sense.

TIA
 
There's already a form for controlling group permissions so creating another form for that is just re-inventing the wheel.
 
Hi and thanks for the reply.

i am not aware of the form you mention, could you elaborate please ?

thanks
 
i am developiong in 2010 but ideally need it to run in 2003 onwards

thanks again
 
That's fine, you can develop in 2010 but it would have to be a 2003 db for the workgroups and permissions to work. Here are the commands you would need to instantiate:

DoCmd.RunCommand acCmdUserAndGroupAccounts
DoCmd.RunCommand acCmdUserAndGroupPermissions
DoCmd.RunCommand acCmdUserLevelSecurityWizard
 
so this is basically launching the same forms as from the access menus when logged in as an admin ?
do i have to elevate the user or create a new workspace or something before using them to do administrative tasks within the actual DB ?
can i use this method to alter the backend database as well as the front ( from the same form in the frontend)
the reason i wanted to implement this is i work on this offsite and then transfer changes to the live database, and i often forget to change the table permissions, the database is often in use when i arrive and it is awkward to get everyone to log out, so i wanted a 'live' to change these permissions. is this feasible or am i chasing the wrong tail ?
 
Any user can call those dialog boxes/wizard.

The backend is where your tables sit, whereas the frontend will contain forms, reports, queries, macros and modules. With that said, and if memory serves me right, permissions in Access are for tables and queries. And if I remember correctly too, it's the owner/creator of the table or a user with full rights that can change existing permission.

Regarding making changes and having them effective right away even if the table is being used, I don't remember. You will have to try it out. Unless someone who still uses it or has access to an old version of Access can confirm this.
 
ok, thanks for the info.

I will have to try a few tests and see what is possible, am i correct in thin king that using these forms modify the MDW file rather than the DB?

I dont think any changes will work while the table is in use, but hopefully will take effect next time the user opens said table.

help appreciated, many thanks
 

Users who are viewing this thread

Back
Top Bottom