Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop columns & rename column names
Message
 
 
To
24/09/2003 02:25:07
Harro Schippan
Datentechnik Schippan Gmbh
Düsseldorf, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00831341
Message ID:
00831745
Views:
25
Hi Harro,
Yes i wanto to do it your sample. but it gives error to me i've modified some sections but was not succesful.

here is the modified code
CLOSE ALL
CLEAR all
SET SAFETY OFF 
clea
Path = "c:\"
FileName = "cs_03-06" && 
? "Process: ",FileName 
select 0
import from (Path)+(FileName)+".xls" type xl8
***************************************************************
* Rename Fields from A,B,C,... to the first line of Excel-Sheet
? ALIAS()
BROWSE

SELECT ALIAS()
anz1 = afields(feldertab) && create Array (fieldnames of dbf)
zwi = "alter table ALIAS() " && build "Alter Table" statement 
for lauf = 1 to anz1 && build "Alter Table" statement
zwi = zwi + " rename column &feldertab(lauf,1). to " + ;
alltrim(&feldertab(lauf,1).)
endfor
? zwi && only for Test; display generated statement
&zwi && do Alter Table
delete && set delete flag for record with fieldnames
pack && delete physical record with delete mark 
&zwi gives error "syntax error"
Previous
Reply
Map
View

Click here to load this message in the networking platform