Accounting for SPACE in location

TimE

Registered User.
Local time
Today, 05:00
Joined
May 17, 2005
Messages
55
When the startup form is opened, I have code that checks to see if a file exists. If it does not, then it will be copied to the local computer. Problem is, the path contains a space. How do I account for this? When I change source to one without a space, it works fine. I do not have control of the path name, so having it changed is not an option

SAMPLE CODE:
Code:
sDestination = "C:\TESTDB\"
sSource = "\\testdb\misc\prod test\Restore"

FileCopy sSource & sFile1, sDestination & sFile1
 
not sure about "filecopy" but you could try putting it in single quotes:

FileCopy "'" & sSource & sFile1 & "'", "'" & sDestination & sFile1 & "'"
 
The source and destination should not matter about having spaces in them. What does matter is making sure both have the backslashes in the path. I noticed that your destination has the backslash but the source string does not.
 

Users who are viewing this thread

Back
Top Bottom