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

FileCopy in VB5

Status
Not open for further replies.

rubicon

Programmer
Jan 23, 2000
1
US
I need to transfer an entire folder from a computer onto a thumbdrive. I have the routine set up so you can select the drive the thumbdrive is in and I am using the command below but I keep getting the error 'Path/File access error'. Any ideas what is happening?

DBPath$ = <Drive selected>
SourceFile = "c:\program files\geomanager\Photos"
DestinationFile = DBPath$&"Photos"
FileCopy SourceFile, DestinationFile

I even added a routine to check if the directory was present on the thumbdrive and if it was not then it is created with the command:

MkDir DBPath$&"\Photos"

Thanks for any help you can give me. I've been writing in VB5 for a long time but never attempted this procedure.
 
Perhaps you need to add a backslash in your statement DestinationFile = DBPath$&"Photos" so it reads DestinationFile = DBPath$&"\Photos" ?
 

To loop thru files in a folder, check Dir in your VB help (F1)

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top