Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax error
Message
From
27/08/2008 04:07:52
 
 
To
27/08/2008 04:00:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01341460
Message ID:
01342115
Views:
13
if you main when i make replace via textboxes it's characters and numbers ,

if you main excel sheet i have some fields have numbers ,and some fields have characters and ONE field have first record as blabla and next as #



>What is the value of OldName when you get this error?
>What is the value of NewName when you get this error?
>
>>Also make sure that you don't try to add a new field with the same name as an old field.? i'm sure,
>>
>>is alter code is correct and table name....
>>i get error message syntax error only when i make alter at
>>ALTER TABLE (tt) RENAME COLUMN (m.OldName) TO (m.NewName)&& syntax error
>>
>>>Also make sure that you don't try to add a new field with the same name as an old field.
>>>
>>>>Make sure that m.NewName is a legal field name, it must start with a character? i have fields as f51,one1,fifi5 another fields is chracters lesthan 10.
>>>>can not include spaces? sure
>>>>i have no problem with excel sheet fields, if i remove ... alter... it works
>>>>
>>>>ALTER TABLE (TT) ADD COLUMN TXPNO C(19)
>>>>ALTER TABLE (TT) ADD COLUMN YEARe C(6)
>>>>ALTER TABLE (TT) ADD COLUMN INFTYPE C(2)
>>>>ALTER TABLE (TT) ADD COLUMN INFDATE C(12)
>>>>ALTER TABLE (TT) ADD COLUMN OFFCODE C(6)
>>>>ALTER TABLE (TT) ADD COLUMN ENTRYID C(15)
>>>>ALTER TABLE (TT) ADD COLUMN ENTDATE C(12)
>>>>ALTER TABLE (TT) ADD COLUMN CONFFLAG C(3)
>>>>ALTER TABLE (TT) ADD COLUMN CONFID C(12)
>>>>ALTER TABLE (TT) ADD COLUMN CONFDATE C(12)
>>>>
>>>>
>>>>>Make sure that m.NewName is a legal field name, it must start with a character, and can not include spaces. And note that in your code, in the For-Next loop, you don't Add fields, you Rename them!
>>>>>
>>>>>>thank you fro reply,
>>>>>>Is m.NewName more than 10 characters?no
>>>>>>
>>>>>>i try without ALTER TABLE (TT) ADD COLUMN TXPNO C(19) && it works
>>>>>>
>>>>>>but still i need to add this fields via internal vfp code
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Is m.NewName more than 10 characters?
>>>>>>>
>>>>>>>>hi all,
>>>>>>>>
>>>>>>>>i try this code before it works, i try it again i get error message syntax error
>>>>>>>>
>>>>>>>>
>>>>>>>>thisform.text11.Value=GETFILE('xls')
>>>>>>>>
>>>>>>>>IMPORT FROM (thisform.text11.value) TYPE xls
>>>>>>>>
>>>>>>>>use JUSTSTEM(thisform.text11.value)
>>>>>>>>tt=JUSTSTEM(thisform.text11.value)
>>>>>>>>USE (tt) excl
>>>>>>>>
>>>>>>>>
>>>>>>>>ALTER TABLE (TT) ADD COLUMN TXPNO C(19)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN YEARe C(6)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN INFTYPE C(2)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN INFDATE C(12)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN OFFCODE C(6)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN ENTRYID C(15)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN ENTDATE C(12)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN CONFFLAG C(3)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN CONFID C(12)
>>>>>>>>ALTER TABLE (TT) ADD COLUMN CONFDATE C(12)
>>>>>>>>
>>>>>>>>replace TXPNO WITH THISFORM.TEXT1.Value
>>>>>>>>replace YEARe WITH THISFORM.TEXT2.Value
>>>>>>>>replace INFTYPE WITH THISFORM.TEXT3.Value
>>>>>>>>replace INFDATE WITH THISFORM.TEXT4.Value
>>>>>>>>replace OFFCODE WITH THISFORM.TEXT5.Value
>>>>>>>>replace ENTRYID WITH THISFORM.TEXT6.Value
>>>>>>>>replace ENTDATE WITH THISFORM.TEXT7.Value
>>>>>>>>replace CONFFLAG WITH THISFORM.TEXT8.Value
>>>>>>>>replace CONFID WITH THISFORM.TEXT9.Value
>>>>>>>>replace CONFDATE WITH THISFORM.TEXT10.Value
>>>>>>>>
>>>>>>>>USE (tt) excl
>>>>>>>>
>>>>>>>>FOR gnCount = 1 TO FCOUNT( )
>>>>>>>>   m.OldName =  FIELD(gnCount)
>>>>>>>>   m.NewName = ALLTRIM(EVALUATE(FIELD(gnCount)))
>>>>>>>>
>>>>>>>>   *******************************************************
>>>>>>>>   ALTER TABLE (tt) RENAME COLUMN (m.OldName) TO (m.NewName)&& syntax error
>>>>>>>>next
>>>>>>>>
>>>>>>>>
>>>>>>>>thank you
>>>>>>>>
>>>>>>>>thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform