Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert fields type
Message
From
22/06/2006 06:10:08
 
 
To
22/06/2006 06:06:33
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:
01130742
Views:
18
i'll give try.
thanks
>>thank you,
>>about,
>>Create table yourtable ... && With the structure you want
>>Append from dbf('curtemp')&& evrey time i need to import deffierent excel
>>sheet(mean some excel sheet have q1 to q15, another sheet have q1 to q30 or more ...etc,
>>that's mean i must add another fileds if more q,as manualy..
>>
>>what i need if it can, at the same code as program
>>
>>import excel sheet to vfp.dbf
>>convert every fileds begin with q
>
>AFAIK you have to do this in steps, like I explained. But I do it myself in many places, it's easy and fast, especially if you use cursors wherever possible.
>
>>anyway thank you very much.
>>
>>
>>
>>
>>
>>
>>
>>>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.
>>>
>>>>thank you for reply,
>>>>
>>>>i mean something as vfp code(program),if it is possible
>>>>
>>>>as example
>>>>use mytable
>>>>locate for field name  begin with q
>>>>scan
>>>>convert(alter) character type  to numaric type
>>>>endscan
>>>>
>>>>thanks again.
>>>>>>hi all,
>>>>>>
>>>>>>after import an excel sheet to vfp.dbf,
>>>>>>i have many fileds begin with q as q1,q2,q1a...etc.. all fields is characters type , i need to change all fields begin with q to numaric type .
>>>>>>
>>>>>>thanks for help.
>>>>>
>>>>>Look up the command Alter Table in help.
Previous
Reply
Map
View

Click here to load this message in the networking platform