Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alter ,append and code
Message
From
13/04/2006 06:04:41
 
 
To
13/04/2006 03:00:28
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:
01113303
Views:
15
>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()?
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform