Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alter ,append and code
Message
From
13/04/2006 06:12:11
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01113274
Message ID:
01113306
Views:
10
hi,
thank you very much, it works,

i add another code to convert it to excel but i need after convert and save to return autamiticly to my directory
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 directory
thanks
>>hi all,
>>
>>any idea help ,
>>
>>is there away to don this idea under at mytext
>>
>>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())
>>
>>
>>thanks
>
>As I understand you, this is what you want (not tested - you can do that)
>
>Give your form's text fields name, e.g. Thisform.txtXLSFile
>
>First: Somehow you get the XLS file name (e.g. click a Get File browse button where you set a form field to the name, as:
>
>in form's GetXLSFile method.
>
>
>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
>
>
>Why have a field that is set to RecNo() when every record will already HAVE this IN recno()?
Previous
Reply
Map
View

Click here to load this message in the networking platform