Why does a user gets a Runtime error 70 with Permission Denied when attempting to delete the XLS files in a folder C:\SENTSPRING on his local drive ?

Posted on 2006-04-19
Last Modified: 2012-05-05
In my Access application I use Access as the front end and SQL Server as the backend database. In a sub-procedure
I first checks to see whether or not the user has a folder on his local C: Drive and if so, delete all .XLS files within this folder.

I placed the Access adp file on a server. Then a user accesses the apd file on the server. When the application reaches the line:

     Kill "C:\SENTSPRING\*.XLS"  <--------------   this line is highlighted in yellow by the compiler

A runtime error is generated        Runtime Error 70
                                                 Permission Denied

The user does not have permission to delete the XLS files in a folder C:\SENTSPRING on his local drive.

Do you know how I can avoid this error ?

'Kill "C:\IIG\CASH_CONTROL\ccshared\AbandonedProperty\TEST\*.XLS"
    If isFileExist("C:\SENTSPRING\*.XLS") Then
       Kill "C:\SENTSPRING\*.XLS"
    End If
Question by:zimmer9
    LVL 36

    Accepted Solution

    this is likely a windows permissions error.
    the user will need to be given full permissions to the folder in question
    LVL 3

    Expert Comment

    is the file open?
    LVL 11

    Expert Comment

    Another reason that this error can get thrown is that the user actually has the file open in Excel when your code tries to delete it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now