Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field name is dup or invalid problem
Message
De
08/10/2007 17:03:14
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
 
À
08/10/2007 16:33:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01259572
Message ID:
01259583
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>Hi All,
> I am blind today. I have the following in code and get the error "Field name is a duplicate or invalid" when it hits the create table line. lcFilename is a valid path and new table name, no table by that name in the directory.
>
>  lcFilename = gPrintTables + "trnsct3.dbf"
>  ...
>  CREATE TABLE (lcFilename) FREE ( contract_id C(12), service_id C(12), ;
>     sub_id C(3), startdate D(8), enddate D(8) )
>
>
>Can someone tell me, please, what I am missing? It looks the same as four other lines I have in other progs.

"contract_id" is 11 characters, longer than limit of 10 for free tables.

Another useful tip is to not include lengths for field types such as Date, Datetime, Integer etc. which have only one possible length e.g. use
... startdate D, enddate D ...
This avoids any chance of errors caused by typing in the wrong size, mismatching parentheses etc.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform