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

Posted on 2012-09-20
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
    LVL 17

    Accepted Solution


    Author Comment

    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

    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

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
    This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now