Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACCESS: need code to delete files from disk 1

Status
Not open for further replies.

TeddB

MIS
Jul 16, 2001
38
US
Help Wanted !!

I have an Access query containing names of thousands of filenames, which need to be deleted from disk.

Can this be done entirely from Access? If so, could you please give me a code example.

Much obliged :->
Ted
 
something like this. use the Kill procedure with full path to delete a file.

Sub main()
Dim strPath As String
strPath = "d:\temp\Book13.xls"
Call sbDeleteFile(strPath)
End Sub

Public Sub sbDeleteFile(strFullFilePath As String)
If Dir(strFullFilePath) <> &quot;&quot; Then Kill strFullFilePath
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top