Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field name is dup or invalid problem
Message
From
08/10/2007 17:03:14
 
 
To
08/10/2007 16:33:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01259572
Message ID:
01259583
Views:
17
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform