Temporarily grant read permissions to a folder on Windows Server 2008 using Access 2010 VBA

Posted on 2012-09-20
Medium Priority
Last Modified: 2012-10-22
Hi.  We have an Access 2010 database that gives users a link to click to view files in a folder on our network called PDF_Files.   The server where the folder is located has Windows Server 2008.

The data in the database is protected in such a way that users can only view records that they are allowed to see (we have a SQL Server backend) and therefore will only be able to view files in the PDF_Files folder that they are allowed to see.

We recently protected the PDF_Files folder so no users can get into the folder directly.  Previously it was wide open.  Now the link in the database is not allowing them to view the PDF files.

Is there a way, using VBA, that I can temporarily allow permissions to view files in the folder for a user only when they are coming from the database and then take those permissions away again after the file opens?

Question by:alexisbr
  • 2
LVL 17

Accepted Solution

Barry Cunney earned 2000 total points
ID: 38418220

Author Comment

ID: 38418824
Thanks, bcunney.  I looked for quite a while but didn't see this link.

I applied this logic to my code and it appears to work but only when I am logged on as me - I see the message at the end that permissions have changed which means it did not bomb as it did not hit any of the error messages in the if statement.  

I have admin privileges to all the servers.  When I log on as another ID that I use to test and this ID does not have admin rights to anything, the code doesn't work and is just skipped.  I read the comments at the top and it does say that you have to be an adminstrator on the machine where the folder resides.

Can you think of any way I can handle this for users who are not admin?


Author Comment

ID: 38522331
I am going to close this question since no one else has any suggestions.  Bcunney's post was a good start but I will have to figure out another way to handle it.  


Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question