Solved

How to erase all files in a Directory within MS Access

Posted on 2012-03-22
4
249 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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.

743 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

11 Experts available now in Live!

Get 1:1 Help Now