Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy and insert
Message
From
14/05/2006 03:09:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Copy and insert
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01121734
Message ID:
01121734
Views:
55
hi all,

i need help to fix this code below, to make copy and insert form the same table before delete the table..
&&&&via event click

m.PathToFile1 = "[z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\]"
lcSearchFile1 = m.PathToFile1+"main2" 
IF FILE(m.lcSearchFile1+".dbf")
         ***try 1*******
*SELECT 2           & not work
*USE main2          ¬ work
*GO TOP IN main2    ¬ work
*IF NOT EOF("main2")¬ work
**************try 2********************
*USE (m.lcSearchFile1+".dbf")           ¬ work
*GO TOP IN (m.lcSearchFile1+".dbf")     ¬ work 
*IF NOT EOF("(m.lcSearchFile1+".dbf")") ¬ work 
****************try 3***********************************
*USE FILE(m.lcSearchFile1+".dbf")           ¬ work
*GO TOP IN FILE(m.lcSearchFile1+".dbf")     ¬ work 
*IF NOT EOF ("(m.lcSearchFile1+".dbf")")    ¬ work 
************************************************************
    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")
    else
        COPY  TO (gcDelimName) XL5
    ENDIF
 endif
********************************************
insert INTO mstr ;   && not work
                 SELECT * FROM FILE(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 
thanks
Next
Reply
Map
View

Click here to load this message in the networking platform