Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy and insert
Message
From
14/05/2006 04:02:22
 
 
To
14/05/2006 03:19:41
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
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:
01121734
Message ID:
01121738
Views:
16
hi,
thank you so much, the first stage copy it works, but insert still, any idea
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")
    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

>Try m.PathToFile1 = "z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\"
>Not m.PathToFile1 = "[z:\smd\INFORMATIONTECHNOLOGYFOLDER\Programs\New Folder\]"
>
>Always use Alias not the number as you never know what it is going to be
>i.e. USE main2
> select main2
>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform