Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with file copy
Message
 
To
07/01/2015 05:37:33
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01613217
Message ID:
01613233
Views:
39
>>>>>>hh="d:\outmail\out"+TTOC(DATETIME())+".dbf"
>>>>>>hh=STRTRAN(hh," "+"")
>>>>>>hh=STRTRAN(hh,":"+"")
>>>>>>hh=STRTRAN(hh,"/"+"")
>>>>>>
>>>>>>
>>>>>>the value of hh is d:\outmail\out07012015084913.dbf
>>>>>>
>>>>>>SELECT outmail
>>>>>>
>>>>>>COPY TO &hh
>>>>>>
>>>>>>I get invalid path or filename - what am I doing wrong?
>>>>>>
>>>>>>d:\outmail dirctory exists exists as does the file outmail
>>>>>
>>>>>Do not use macro, use Name expression instead.
>>>>>Also make sure that "d:\outmail\ folder exists
>>>>>
>>>>>hh="d:\outmail\out"+TTOC(DATETIME())+".dbf"
>>>>>
>>>>>hh=CHRTRAN(hh," :/", "")
>>>>>
>>>>>SELECT outmail
>>>>>TRY
>>>>>   md ("d:\outmail\") && It is closed in quotes and brackets just in case there are spaces in the folder name
>>>>>CATCH
>>>>>ENDTRY
>>>>>
>>>>>COPY TO (hh) && Here
>>>>>
>>>>
>>>>I still get the error - d:\outmail exists
>>>
>>>change code
>>>to
>>>
>>>hh="d:\outmail\out"+TTOC(DATETIME())+".dbf"
>>>
>>>hh=CHRTRAN(hh," :/", "")
>>>
>>>SELECT outmail
>>>TRY
>>>   md ("d:\outmail\") && It is closed in quotes and brackets just in case there are spaces in the folder name
>>>CATCH
>>>ENDTRY
>>>
>>>_CLIPTEXT = hh
>>>
>>>COPY TO (hh) && Here
>>>
>>>
>>>Paste Clipboard content in the next message.
>>>
>>>What happens if you change
>>>
>>>COPY TO (hh) && Here
>>>
>>>to
>>>
>>>COPY TO d:\outmail\outxyz.dbf
>>>
>>>
>>>?
>>That copies fine
>
>first, just try backwards until it fails, adding more steps, going from working example.
>Your Chrtran() looks very suspicious, as it deletes slash and double colon but leaves backslash in path

Have changed my chrtran and it now works fine - thanks for all your help
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Previous
Reply
Map
View

Click here to load this message in the networking platform