From: Lincoln on
I have a secured database created with Access 2003, and used by Office
2007 users. I need to grant privileges to a query; that for reasons of
design, is deleted and recreated based on user input. It seems that
deleting the query removes the privileges with it. Obviously their may
be other ways of doing this, but I am locked in.

I am looking to grant privileges to a query, lets call it,
"my_deleted_and_replaced_query" using VBA code in a module, and need
help with the syntax. It should go something like this:

Grant privileges to my_deleted_and_replaced_query for all users or
groups in the database.

Lincoln
From: Rick Brandt on
Lincoln wrote:

> I have a secured database created with Access 2003, and used by Office
> 2007 users. I need to grant privileges to a query; that for reasons of
> design, is deleted and recreated based on user input. It seems that
> deleting the query removes the privileges with it. Obviously their may
> be other ways of doing this, but I am locked in.
>
> I am looking to grant privileges to a query, lets call it,
> "my_deleted_and_replaced_query" using VBA code in a module, and need
> help with the syntax. It should go something like this:
>
> Grant privileges to my_deleted_and_replaced_query for all users or
> groups in the database.

Since the SQL of a query can be changed via code there is no reason to
delete it and recreate it.