Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Substitution
Message
From
25/01/2002 10:44:04
 
 
To
25/01/2002 09:34:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00610434
Message ID:
00610511
Views:
22
>I want to create a table with a date-stamp name. I tried the following code and I keep getting a "Cannot create file error". Can anyone help me? (I'm using VFP7)
>
>pay_dbf="\data\PR"+RIGHT(DTOS(Date()),6)+".dbf"
>
>Copy file payroll to &pay_dbf

If the file you are copying is closed, this is the syntax you want:
lcPay_Dbf = "\data\PR"+RIGHT(DTOS(DATE()),6)+".dbf"

COPY FILE payroll.dbf TO (lcPay_Dbf)
Note that the extension must be included, and that this only copies the .dbf, not the .cdx or .fpt. Those have to be copied separately.

If the file is open, this is the syntax you want:
lcPay_Dbf = "\data\PR"+RIGHT(DTOS(DATE()),6)+".dbf"

SELECT payroll
COPY TO (lcPay_Dbf)
This includes all relevant files (.fpt and .cdx).
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform