Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing from Excel
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01130272
Message ID:
01130276
Views:
13
>I have a situation where I was importing data from an Excel spreadsheet and it worked fine. I created the cursor to import to by doing a SQL Select from another table, taking some of its fields as is and adding a COST field. The spreadsheet format matched the table format. Worked like a champ. Then I said "Hey, if you add these other two fields to your spreadsheet, we can do so-and-so" to which the client agreed. So they just tacked the two columns on to the spreadsheet (a 5 column spreadsheet became a 7 column spreadsheet) and I tacked the same two columns on to the end of the table I'm using for the import. And now the import is screwed up. The first column, part number c(12), is not coming in at all - it's just blanks. The two new fields are also not being populated.
>
>Here's the code:
>
>
>select partnum, list_price, dlr1_price, exp1_price, 00000.00 as cost,;
>       classid, descr;
>   from parts;
>   where .f.;
>   into cursor NewPrices readwrite
>append from "2006 Parts.xls" type xl8
>
>
>In the previous code (and spreadsheet), the CLASSID and DESCR fields did not exist. Now they do and the data is not imported as expected. Anybody seen anything like this?
>
>Russell Campbell

Aren't classid and descr memo by any chance? If so you can't import them.
If so try this:
select partnum, list_price, dlr1_price, exp1_price, 00000.00 as cost,;
       SPACE(255) AS classid, SPACE(255) AS descr;
   from parts;
   where .f.;
   into cursor NewPrices readwrite
append from "2006 Parts.xls" type xl8
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform