Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing data from MS Excel

Status
Not open for further replies.

Rogy

Programmer
Nov 20, 2002
43
SI

I imported data from MS EXCEL '97 with this code:

IMPORT FROM "c:\temp\some_data.xls" TYPE XL8 SHEET "Sheet3"

I got a table some_data.dbf

The problem is I want to import data directly to the
table mytable.dbf

How can I do that?
 
Rogy

Take a look in the Help file at the APPEND command. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike

I tried with APPEND FROM but I get Fatal Error message.

this is how I did it:

USE mytable
APPEND FROM "c:\temp\some_data.xls" TYPE XL8 SHEET "Sheet3"

I don't know why it doesn't work.


P.S.: I use VFP 6.0
 
morning

does the table you're trying to append into have a corresponding structure to the XLS file?

use table1 in 0
APPEND FROM "c:\a.xls" TYPE XL8 SHEET "bm5_g3_2"

It appended in OK - i got a share violation when i had the XLs file open when i tried to import it.

If you don't really need to import from XLS (i.e only have 1 worksheet to import manually - rather than many automatically) have you tried saving the XLS sheet to a CSV, SDF or Tab delimited file?

monkey
 

The spredsheet is in MS Excel 97 format.

Well, this is what I did:


IMPORT FROM "c:\temp\some_data.xls" TYPE XL8 SHEET "Sheet3"

I get table SOME_DATA.DBF

CREATE TABLE MYTABLE.DBF ( here is the same structure than SOME_DATA.DBF)

SELECT MYTABLE
APPEND FROM SOME_DATA.DBF

Well it isn't the best sollution, but it works (I get what I want :) )

Thanks for help!

Rogy




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top