Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus
Message
From
15/05/2006 09:56:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01121830
Message ID:
01121891
Views:
17
hi,
thank you for reply,

this is the all code via event valid,
but not works......i think...rong bosition
m.PathToFile1 = "z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\"
lcSearchFile1 = m.PathToFile1+"main2" 
IF FILE(m.lcSearchFile1+".dbf")
 USE main2 
select main2
GO TOP IN main2    
IF NOT EOF("main2")

    gcDelimName = ALIAS( ) + '.xls'
    gcPath = [w:\Quality Test 01\mtest\]
    gcDelimName =  gcPath +   DTOS(file_date) +  ".XLS"
   
    lcFile=gcDelimName

    if adir(dummy,lcFile)>0
        MESSAGEBOX(" file exists")
        THISFORM.TEXT1.SetFocus()
       * RETURN
    else
        COPY  TO (gcDelimName) XL5
    ENDIF
 endif
********************************************
insert INTO mstr ;
               SELECT * FROM main2 WHERE file_date NOT IN (SELECT file_date FROM mstr)
*******************************************************
   DELETE FILE(m.lcSearchFile1+".dbf")
   DELETE FILE(m.lcSearchFile1+".cdx")
   DELETE FILE(m.lcSearchFile1+".fpt")
ENDIF 
******
SET DEFAULT TO [w:\Quality Test 01\Source Data]
thisform.text9.Value=GETFILE('xls')
CREATE TABLE [z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\main1.dbf];
(msisdn n(15),num n(8),date d(8) ,flag n(2),pstn n(3) )
APPEND FROM (thisform.text9.Value) TYPE xl5
Replace Date  with thisform.text1.value ;
        flag   with 0 ;
        pstn WITH 0;
               num with RecNo() ALL
        
    
*********************************************
CREATE TABLE [z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\main2.dbf];
(num n(8),survey_num n(2),msisdn n(15),file_date d(8) ,intervdate d(8),status n(2),othersst c(100),con_type c(20) )               
*************************************************
SET DEFAULT TO ([w:\Quality Test 01\Source Data\])
COPY FILE (thisform.text9.Value ) TO [w:\Quality Test 01\mtest\]+(JUSTFNAME(thisform.text9.Value ))
SET DEFAULT TO ([w:\Quality Test 01\Source Data\]
ERASE (thisform.text9.Value).xls
thanks.

>This code seems to be fine, but it may not work depending from where do you call it.
>
>>hi all,
>>
>>i try to keep the Cursor at text1 if the file found,
>>but it complate all the code.
>>
>>
>>if adir(dummy,lcFile)>0
>>        MESSAGEBOX(" file exists")
>>        THISFORM.TEXT1.SetFocus()
>>       * RETURN
>>    else
>>        COPY  TO (gcDelimName) XL5
>>    ENDIF
>> endif
>>.
>>.
>>.
>>.
>>.
>>
>>
>>thanks for help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform