Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Substitution
Message
De
25/01/2002 10:44:04
 
 
À
25/01/2002 09:34:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00610434
Message ID:
00610511
Vues:
23
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform