Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2007

Tip: Looking for answers? Try searching our database.

How to delete i file from Visual Basic?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kjell - 14 Jan 2006 10:23 GMT
Hi,

From inside Access I want to delete a file in a directory. How will the
Visual Basic look like?

Access 2002

Any help will be appreciated!
Regards
Signature

Kjell

Alex Dybenko - 14 Jan 2006 11:01 GMT
Hi,
you can use Kill statement

Kill "C:\myfile.txt"

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi,
>
[quoted text clipped - 5 lines]
> Any help will be appreciated!
> Regards
samuel - 14 Dec 2007 15:51 GMT
what about an if statement to see if the file exists.

if it doens't, do nothing.

if it does, then delete.

> Hi,
> you can use Kill statement
[quoted text clipped - 10 lines]
> > Any help will be appreciated!
> > Regards
Alex Dybenko - 15 Dec 2007 07:41 GMT
Hi,

if len(dir( "C:\myfile.txt"))>0 then _
   Kill "C:\myfile.txt"

Signature

Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

> what about an if statement to see if the file exists.
>
[quoted text clipped - 16 lines]
>> > Any help will be appreciated!
>> > Regards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.