Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wierd Problems
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01154972
Message ID:
01155151
Views:
30
Steve,

I've seen VFP choke on certain XLS files because of the content of the spreadsheet itself. I think there is a KB article or two about problems with the XLS file, one of them related to how many times something had been pasted into the spreadsheet. Really oddball stuff like that.

If at all possible I'd go the route of using automation to have Excel open the XLS file and do a SaveAs a csv file and let your program append the CSV into the correct table structure.

>The first couple of tries, your test program did not choke on the copy
>to type delimited command. But nothing would be in the test.txt file.
>
>create cursor x1 ( i1 i, c1 c(10) )
>insert into x1 values ( 1, 'test' )
>copy to test.txt type DELIMITED
>modi file test.txt

if test.txt is empty then there is something WAY whacked out on your system. That above code should work flawlessly every time it's executed (assuming of course that you close the edit window before you try to run it again). Are you sure you have file create/write rights in the current directory?

>
>But since the copy to delim was working, I tried it with the offending table
>which happens to be called IB2005. The first time
>copy to ibAll.txt type DELIMITED
>worked. Then I tried a
>copy to test.txt type DELIMITED with ";"
>And got the error. Now, however, this brings an error at the copy to
>delim command.
>create cursor x1 ( i1 i, c1 c(10) )
>insert into x1 values ( 1, 'test' )
>copy to test.txt type DELIMITED &&invalid path or file name
>
>But if I do a copy command with a different file name, it works
>copy to est.txt type DELIMITED &&works fine
>modi file est.txt && shows the values inserted into cursor
>
>This has me confused. I thought that the copy command was supposed to
>overwrite the destination file? Is IB2005.dbf is corrupted is their a way
>to repair it. In my program, IB2005 gets created by having foxpro open up
>an excell worksheet, write it to a DBF file, which foxpro then opens and uses.
>So the table is actually created by excel. Assuming that the file from
>excel might be corrupted, I suppose I could get around that
>by having excel write as csv file and then appending that into a table created
>programmatically in foxpro.
>Steve
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform