|
-
Mar 9th, 2003, 05:39 PM
#1
Thread Starter
New Member
Deleting/Killing a file... help!
Hello, this is my first post here on the VBForums. Since I just got VB 6.0 and I learned how to use it last year it's a lot of fun just playing around with it. Yesterday I d/l an MP3 player and modified it a little bit. But I have 1 problem, when I try to delete a file that is in my list, I can't because I get an error. I haven't learned how to delete files yet so if anyone can clue me in, that would help out a lot.
Private Sub Command3_Click()
Kill File1.path & "\" & File1.FileName << Says there's an error in this line
File1.Refresh
End Sub
Any help is greatly appreciated, thanks!
-
Mar 9th, 2003, 05:45 PM
#2
Frenzied Member
What does the error message say?
-
Mar 9th, 2003, 05:48 PM
#3
Thread Starter
New Member
Run-time error '53':
File not found
The purpose of the delete button is to delete a file that I added from my hard drive into my playlist... So I click on the file and then click delete and that's the error message that I get.
-
Mar 9th, 2003, 06:09 PM
#4
Frenzied Member
Are you making sure the file is actually there, you dont have the path incorrect or somthing
-
Mar 9th, 2003, 06:15 PM
#5
Thread Starter
New Member
Yeah I'm sure it's there........ I select it and it becomes highlighted and then click delete and i get that error.
-
Mar 9th, 2003, 06:32 PM
#6
Lively Member
does file1.path already have a '\' at the end of it?
-
Mar 9th, 2003, 06:41 PM
#7
Thread Starter
New Member
-
Mar 9th, 2003, 06:46 PM
#8
Lively Member
try this for debugging:
Private Sub Command3_Click()
a=File1.path & "\" & File1.FileName
msgbox a
Kill a
File1.Refresh
End Sub
-
Mar 9th, 2003, 08:06 PM
#9
Thread Starter
New Member
Doesn't work... Can you please e-mail me at [email protected] so I can send you the program and you can see what's wrong? That would be so great of you... Thanks.
-
Mar 9th, 2003, 08:14 PM
#10
Fanatic Member
VB Code:
Dim sFile As String
sFile = Replace(File1.Path & "\" & File1.FileName, "\\", "\")
If Dir(sPath) = vbNullString Then
MsgBox "The following file does not exist:" & vbCrLf & sFile, vbExclamation
Else
Kill sFile
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|