Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert fields type
Message
De
06/03/2007 05:06:29
 
 
À
06/03/2007 04:52:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01130716
Message ID:
01200960
Vues:
22
thank you very much, it works
If left(Upper(gaMyArray(nCount,1)),1)='Q' and gaMyArray(nCount,2)='C'
>My code will work with SET EXACT OFF. Another solution, which is independent of EXACT:
>
>If left(Upper(gaMyArray(nCount,1)),1)='Q' and gaMyArray(nCount,2)='C'
>
>
>>HI,
>>if my field start with q,qa,q1,q21,qe4 or qa27..., how i can let this vfp code work.
>>
>>
>>If Upper(gaMyArray(nCount,1))='Q' and gaMyArray(nCount,2)='C'
>>
>>thanks
>>
>>>>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.
>>>>>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform