Home All Groups Group Topic Archive Search About

set query permissions in VBA

Author
3 May 2007 9:26 PM
CathyJ
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!!!!!

Author
3 May 2007 9:55 PM
Scott McDaniel
On Thu, 3 May 2007 14:26:00 -0700, CathyJ <Cat***@discussions.microsoft.com> wrote:

>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
Author
4 May 2007 1:52 PM
CathyJ
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!

Show quote
"Scott McDaniel" wrote:

> On Thu, 3 May 2007 14:26:00 -0700, CathyJ <Cat***@discussions.microsoft.com> wrote:
>
> >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
>
Author
3 May 2007 10:48 PM
Aaron Kempf
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


Show quote
"CathyJ" <Cat***@discussions.microsoft.com> wrote in message
news:A2BB5B21-7BA1-443B-9C7C-E3DE42FD1D84@microsoft.com...
> 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!!!!!
Author
4 May 2007 2:07 PM
CathyJ
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.

Show quote
"Aaron Kempf" wrote:

> 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
>
>
> "CathyJ" <Cat***@discussions.microsoft.com> wrote in message
> news:A2BB5B21-7BA1-443B-9C7C-E3DE42FD1D84@microsoft.com...
> > 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!!!!!
>
>
>
Author
4 May 2007 4:50 PM
BruceM
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.

Show quote
"CathyJ" <Cat***@discussions.microsoft.com> wrote in message
news:10C6B034-DF0A-49D8-9F5C-D66B7B07D53B@microsoft.com...
> 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.
>
> "Aaron Kempf" wrote:
>
>> 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
>>
>>
>> "CathyJ" <Cat***@discussions.microsoft.com> wrote in message
>> news:A2BB5B21-7BA1-443B-9C7C-E3DE42FD1D84@microsoft.com...
>> > 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!!!!!
>>
>>
>>
Author
4 May 2007 2:36 PM
Joan Wild
The users would need at minimum read data permissions on the source tables involved in this query.



--
Joan Wild
Microsoft Access MVP
Show quote
"CathyJ" <Cat***@discussions.microsoft.com> wrote in message news:A2BB5B21-7BA1-443B-9C7C-E3DE42FD1D84@microsoft.com...
>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!!!!!
Author
4 May 2007 2:54 PM
CathyJ
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

Show quote
"Joan Wild" wrote:

> The users would need at minimum read data permissions on the source tables involved in this query.
>
>
>
> --
> Joan Wild
> Microsoft Access MVP
> "CathyJ" <Cat***@discussions.microsoft.com> wrote in message news:A2BB5B21-7BA1-443B-9C7C-E3DE42FD1D84@microsoft.com...
> >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!!!!!
>
Author
4 May 2007 9:04 PM
Joan Wild
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.

--
Joan Wild
Microsoft Access MVP
Show quote
"CathyJ" <Cat***@discussions.microsoft.com> wrote in message news:DA4C162D-BEA0-4EE4-805C-651FBA4CD17E@microsoft.com...
> 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
>
> "Joan Wild" wrote:
>
>> The users would need at minimum read data permissions on the source tables involved in this query.
>>
>>
>>
>> --
>> Joan Wild
>> Microsoft Access MVP
>> "CathyJ" <Cat***@discussions.microsoft.com> wrote in message news:A2BB5B21-7BA1-443B-9C7C-E3DE42FD1D84@microsoft.com...
>> >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!!!!!
>>

AddThis Social Bookmark Button