lcXLSFile = GETFILE('xls') Thisform.txtXLSFile.value = lcXLSFile Thisform.Refresh() Import from (thisform.text9.Value) TYPE xl5 lcTableName = JUSTSTEM( Thisform.txtXLSFile.value ) Alter table &lcTableName Add column Date d Alter table &lcTableName Add column cNo I && Integer note - not n( 6) Alter table &lcTableName Add column RecNo I Replace Date with DATE() ; cNo with 0 ; RecNo with RecNo() ALL ********************************* CLOSE all USE JUSTSTEM(thisform.text9.value)+".dbf" in 0 gcDelimName = ALIAS( ) + '.xls' gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls') IF EMPTY(gcDelimFile) CANCEL ENDIF COPY TO (gcDelimFile) XLS SET DEFAULT TO d:\sami &&& any way to return to defualt directorythanks
>>getdir() >>thisform.text9.Value=GETFILE('xls') >>Import from (thisform.text9.Value) TYPE xl5 >>&&APPEND(alter) 3 fields to my table = (thisform.text9.Value) >> >>&&1.as date field (replace date with thisform.text2.value)&&for all record >>&&2.as cno, n(6) field (replace cno with 0 ) && for all records >>&&3.as no, n(9) field (replace ALL No WITH RECNO()) >>>>
>lcXLSFile = GETFILE('xls') >Thisform.txtXLSFile.value = lcXLSFile >Thisform.Refresh() >Import from (thisform.text9.Value) TYPE xl5 >lcTableName = JUSTSTEM( Thisform.txtXLSFile.value ) > >Alter table &lcTableName Add column Date d >Alter table &lcTableName Add column cNo I && Integer note - not n( 6) >Alter table &lcTableName Add column RecNo I > >Replace Date with DATE() ; > cNo with 0 ; > RecNo with RecNo() ALL >>