Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert fields type
Message
From
22/06/2006 09:36:49
 
 
To
22/06/2006 09:26:18
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01130716
Message ID:
01130799
Views:
19
>thank you very much,
>Something like this should work?of course it must:).

Well, I did test it...! :-)

>>Something like this should work
>>Use dnc Exclusive
>>gnFieldcount = AFIELDS(gaMyArray)
>>For nCount = 1 To gnFieldcount
>>  If Upper(gaMyArray(nCount,1))='Q' and gaMyArray(nCount,2)='C'
>>    Wait "Converting "+gaMyArray(nCount,1) WINDOW nowait
>>    Alter table dnc alter column (gaMyArray(nCount,1)) n(10,2)
>>  EndIf
>>EndFor
>>Wait clear
>>
>>>hi,
>>>i need something as vfp example..
>>>
>>>USE dnc
>>>
>>>gnFieldcount = AFIELDS(gaMyArray)
>>>CLEAR
>>>FOR nCount = 1 TO gnFieldcount
>>>   ? gaMyArray(nCount,1)
>>>   alter(all field begin with Q to numaric type)&&& what kind of code i must write to do it?
>>>ENDFOR
>>>
>>>thanks all the time
>>>>Sorry, but I donæt have the time to give you the code. But the easiest is to read the data from the excel file into a temp cursor, and then append the data from the temp cursor into a table which you have already created with the correct structure. In semicode, which is NOT ment to work, only show you briefly:
>>>>*Read the Excel file into the cursor curtemp && Change the code you already use
>>>>Create table yourtable ... && With the structure you want
>>>>Append from dbf('curtemp')
>>>>Another approach is to use Afield() on the table, and then use Alter Table on each field which has a name beginning with q and whick is of type character.
>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform