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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel to dbase 1

Status
Not open for further replies.

dooksdiggy

Technical User
Aug 6, 2004
2
US
What is the dbase command to import a file into dbase?
 
AFAIK, there isn't one. The best, and easiest method is to save the Excel file as a DBF file.

There's always a better way. The fun is trying to find it!
 
dooks:
Reading both your posts and tviman's responses, I'm wondering if you've got what you need? tvi's correct in his statements. However, if you're not familiar with the dBase environment, perhaps he didn't go far enough in his explanation.

If you create a .dbf file from Excel called MyTable.dbf, then you open it in dBase with the command:

USE MyTable

It will have field names defined by the cells in the top row of the Excel columns.

If you're using an existing dBase application that wants to use a specific table that already exists (and you're attempting to create that from Excel), you'll need to be careful to ensure the top row of the spreadsheet mimics the field names in the existing database. Then there may be indexes on the old table that have to be reindexed within the dBase environment with:

USE MyTable INDEX MyIndex
REINDEX

If you are trying to load an existing database within an application, you may be better off to save the worksheet as a text file [tab, space, or comma delimited] and then draw those records into the database with :

USE MyTable
APPEND FROM MyTextFile.txt [SDF, TYPE... or DELIMITED WITH ...]

The exact format of the APPEND command will depend on how you Save As from Excel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top