Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Sandeep Misra
  Where is Sandeep Misra?
 Shelton
 Connecticut - United States
 Sandeep Misra
 Tags
Subject: RE: append data to a database
Thread ID: 112528 Message ID: 112532 # Views: 5 # Ratings: 1
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Thursday, November 09, 2006 12:52:40 PM         
   


> Hi All,
>
> Please help me out with this.
>
> I am trying to append data from a XLS to DBF by executing the following command:
>
> Append from test.xls type xls
>
> It is executing properly when row count in the xls is less (~41). But when row count is 6133 (or any bigger number) it is showing the following error:
> "Microsoft Excel File Format is Invalid"
>
> Please let me know if i can eliminate this error in some way. At the same time please suggest if there is any alternative ways of doing the same.
>
> regards
> sandeep


Sandeep,

I cannot remember way back to VFP 6. Does it give you the option to user TYPE XL5? If so, give that a try.

Another option for you would be to open the spreadsheet using automation and read the data in row by row and field by field. I typically use this approach when dealing with spreadsheets - you would be amazed at what users will do with a spreadsheet. I had one situation where the user added a column to the spreadsheet instead of expanding the column width. (She couldn't see all of the text in the previous column.) By using automation, I can validate each cell as it is read.

You might also try to save the spreadsheet as a comma delimited file and then APPEND FROM ... TYPE DELIMITED.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

append data to a database Posted by sandeep misra @ 11/9/2006 11:48:07 AM
RE: append data to a database Posted by Ken Murphy @ 11/9/2006 12:52:40 PM
RE: append data to a database Posted by Barbara Peisch @ 11/9/2006 7:24:01 PM
RE: append data to a database Posted by Ken Murphy @ 11/9/2006 9:01:17 PM
RE: append data to a database Posted by Barbara Peisch @ 11/9/2006 10:18:02 PM
RE: append data to a database Posted by Ken Murphy @ 11/9/2006 10:21:34 PM
RE: append data to a database Posted by Barbara Peisch @ 11/9/2006 10:22:46 PM
RE: append data to a database Posted by sandeep misra @ 11/11/2006 2:07:12 PM
RE: append data to a database Posted by Ken Murphy @ 11/11/2006 3:31:43 PM