Question : Set Open/Run permissions for reports and queries using VBA

I have some large databases with many users. All of the users are members of a group named '2FullData'. I need to set Open/Run permissions for this group for all of the reports and queries. I need to do this using DAO (ADOX is problematic in my environment). There are an enormous amount of queries and reports in these databases. Doing it manually might take me the rest of the week.
I've been looking at setting permissions for documents in containers, but I don't see a constant for 'open/run'. Also I would need to set a 'user name' for the document before setting the permission; I don't know if a goup would work for that.
Even if containers were to work for reports, I don't see a container for queries, so I'm only half way there at best.
Does anyone have a solution for granting a group Op/run permissions for reports and queries?
Thanks,
Todd

Answer : Set Open/Run permissions for reports and queries using VBA

I agree with Peter - this might take an hour or so, but it'd take that much time (or much longer) to build a VBA utility to do this.

That said, you can certainly apply permissions to Groups, and you don't need to "assign" a user to a particular object. Security constants are hard to find; the only definitive source I've found is in the Microsoft Jet Database Engine Programmer's Guide (Second Edition), from Microsoft Press. This is out of print, but there are plenty of copies available on the big book websites.

The constants you might need for "open/run" for queries/tables would be:

dbSecReadDef
dbSecRetrieveData
dbSecDeleteData
dbSecReplaceData
dbSecInsertData

For forms and Reports:

acSecFrmRptExecute
acSecFrmRptReadDef
acSecFrmRptWriteDef

For databases and other:

dbSecDBOpen
dbSecReadSec
dbSecWriteSec

These all came from the above referenced book.

Random Solutions  
 
programming4us programming4us