Solved

How to erase all files in a Directory within MS Access

Posted on 2012-03-22
4
252 Views
Last Modified: 2012-05-09
Hi guys, I'm trying to write a procedure that:
1)Allows me to erase all the files within a specified directory.
even if
2)The directory is empty.

Thanks!
0
Comment
Question by:Vellenaweth
  • 3
4 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37755689
Kill "C:\YourFolder\*.*"
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37755695
In a lot of systems "Kill" is not allowed...

In that case you can use the "FileSystemObject"
See here:
http://www.freevbcode.com/ShowCode.asp?ID=2381
0
 

Author Comment

by:Vellenaweth
ID: 37758526
Yep, the "kill" stuff gives me a "File not found".
Gonna try the other solution.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 170 total points
ID: 37758710
Well, "File not found" means just that...
It could not find the file.
Be *sure* to check your spelling...
..Check the spelling of the *Folder* as well.

If the file you specify is MyName.txt,
 but the actual file name is: MyName1.txt
...Then any system will display "File not found"
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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.

803 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