set query permissions in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form which has a button that runs code to create a new query in VBA
every time it is clicked (the old query is first deleted). I would like other
users to be able to run this code also, but have not found a way to set the
permissions in VBA to do give them permissions for this query.

I'm sure there must be a way. Can anyone help?

Many thanks!!!!!
 
I have a form which has a button that runs code to create a new query in VBA
every time it is clicked (the old query is first deleted). I would like other
users to be able to run this code also, but have not found a way to set the
permissions in VBA to do give them permissions for this query.

In the User and Group Permissions dialog (Tools - Database Security - User and Group Permissions), select Query in the
Object Type dropdown, then provide the relevant group full permissions (or whatever subset is appropriate) for the <New
Tables/Queries> Object Name. Now when a new query is added, the Group you selected earlier will have the permissions you
indicated.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
you should look up

GRANT EXECUTE

in SQL Server books online



you shouldn't use DAO crap for this; it's ridiculous because DAO has been
depecrated
 
Thanks Scott.

I tried giving both the user and the group Read, Update, Insert & Delete
permissions for New Queries, and I still get the same error. Could it have
something to do with the Tables being in a different place (back-end)? This
user has full permissions for those tables.

Or do I need to give her Administer access? I'd hate to start doing that,
although it doesn't really matter since she can't get to it anyway.

Thanks in advance!
 
Thanks Aaron.

could you please send me a link to an SQL server book that has this in it?
I'm not a programmer, just a lowly marketing type! You would probably have a
heart attack if you saw my code.
 
The users would need at minimum read data permissions on the source tables involved in this query.
 
they have read, update, insert & delete permissions for the four tables
involved in the query. in both the back-end module and the front-end one (I
never know if they need both, so I err on the side of safety).

thanks
 
Ignore Aaron, a bitter and unhappy troll who hates Access, and who has taken
up residence here of late. There are perfectly valid reasons for using SQL
server, but they probably don't apply to the current project.
 
Do any of those four tables have lookup fields defined in them? If so then they need permissions on those as well.

It would help if you posted the text of the error message that occurs when users run the code.
 
Back
Top