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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copyfile IFileSystem3 2147024784 error

Status
Not open for further replies.

jkafer

Technical User
Feb 13, 2004
32
US
I know I have had this working, but for some reason I cannot get this code to work. I am trying to copy datafiles to a USB drive. It will make the folder, I can copy a small file to it using this code (see the copy of the wsca.ico file) to the folder on the USB. But when it comes to copying the datafiles I get this error: "copyfile IFileSystem3 2147024784"

I am working in A2003, but I have compiled it with A2000 to an MDE. If that is the problem, then why when I take the uncompiled file back to A2003 does it give me the same error now.

Also this works fine if I choose to do this to c:, but not the usb drives now. I have tried 3 different brands of USB drives, I have tried 4 different computers.

I know this worked before I compiled it, because I have the folders with the files on a USB drive.

Here's my Code:

'me.floc is a field on the form, by default it's set to c:\wsca
'me.cmbDr is a drop down that you select what drive letter to write to

Set fso = CreateObject("Scripting.FileSystemObject")

Dim strTo, strFrom

strFrom = Me.Floc & "\*_db.mdb"

strTo = Me.cmbDr & "\CEBU" & Format(Now(), "mmddyy") & "\"

strTo2 = strTo

Do While Len(Dir(strTo2, vbDirectory)) <> 0
'creates a unique folder each time it is run - works great
d1 = d1 + 1
strTo2 = Left(strTo, Len(strTo) - 1) & "_" & d1 & "\"
Loop
MkDir (strTo2)
strTo = strTo2
fso.copyfile strFrom, strTo


...
There is more to my code, but it doesn't ever get to it. I also have it using the fso.getfolder to list the files that it backedup.
 
I saw that error too, but the flash drives are mostly empty.
The datafiles I am copying are 1-15 meg in size.
The flash drives that I've tried are 2 and/or 4 gig.

 
have you tried coping them to another destination?
Doesa this throw the same error?

Everybody is somebodys Nutter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top