[AccessD] VB Simple problem. Can't use Kill - CROSS_POSTED VB

Hadyn Morgan hadyn at dataconcepts.co.nz
Wed Feb 26 22:03:00 CST 2003


Hi John

I had a similar problem a while back but with a directory that wouldn't
delete.  Best as I could tell the Dir function seemed to lock the directory
so it could not be deleted.  If you want to test it, try to Kill a file that
you know exists, without doing the Dir first.  I ended up using the
FileSystem Object (search archives re caveats).  Just out of interest what
OS are you using?

Kind regards
Hadyn

----- Original Message -----
From: "John Skolits" <JSkolits at CorporateDataDesign.com>
To: <accessd at databaseadvisors.com>
Sent: Thursday, February 27, 2003 4:06 PM
Subject: [AccessD] VB Simple problem. Can't use Kill - CROSS_POSTED VB


>
> Am I losing it?
>
> Why doesn't the Kill statement work in this VB code.
>
>
> '*********
> Dim strRuntimePath  as string
>
> strRuntimePath ="C:\Program Files\Microsoft Office\ART\Office"
>
> If Len(Dir(strRuntimePath & "\msaccess_SR1.exe")) > 0 Then
>    Kill (strRuntimePath & "\msaccess_SR1.exe")
> End If
> '************
>
>
> The line with "Len(Dir" in it works fine. Bu when the Kill line tries to
run
> I get an error 75 ("Path/File access error")
>
> I can easily rename the file and move it around in explorer so I know it's
> not being used by anything. I've used this syntax before in other VB apps
> with no problem.
>
> If I rename the file through explorer and run that line again it says
Error
> 53 :File Not Found". Which makes perfect sense.
>
> Is it because it's an EXE file?
>
> Am I missing something really obvious?
>
> John Skolits
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>





More information about the AccessD mailing list