Question : 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 ?

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

Answer : 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 ?

this is likely a windows permissions error.
the user will need to be given full permissions to the folder in question
Random Solutions  
 
programming4us programming4us