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

Converting .dbf files to excel or access

Status
Not open for further replies.

cajuntank

IS-IT--Management
May 20, 2003
947
US
I have an accounting application that writes to .dbf and a corresponding .ndx file. We are migrating to another application and I need to be able to export the data out of the .dbf files to something like Excel or Access. I am not a programmer and I do not have VFP in my posession. Is there a way to do this through maybe an ODBC driver or some little utility that will export to even a ASCII or comma delimited format.

Any insights?
 
Hi

That you are using ndx, I suspect the foxpro must be a very old version or it is belonging to some other xbase family.

[If it were CDX then, probably you may not even think of changing over.]

The answer to your question, if this is a foxpro table is..

USE myTable
EXPORT TO myXLSfileName TYPE XLS

This will export to excel files.

If your number of records are more than 16K, then export to text file using command..

COPY TO myFile.txt DELIMITED

:)


ramani :)
(Subramanian.G)
 
Ramani, he doesn't have foxpro.

Cajuntank, you can import foxpro file into excel.
 
If you dont have Foxpro you can still convert dbf tables to Excel. Excel can open dbf tables if they are created in 2.6 format (up to 65K rows). After opening it you can save it as regular Excel sheets. If the dbf are Visual foxpro format you need foxpro and follow the tip Ramani gave.

Kurjo
 
Please elaborate a little more on some of your comments.... again I am very programmer illiterate so when you say
"Use myTable" I have not a foggy idea of this... Is this done from a command prompt or from the directory that houses the foxpro files??? What is a foxpro table?
Please be kind.
 
cajuntank,
If you don't have VFP in your posession, you might be able to open .dbf table from Excel and save it there, or import it to Access, although it all depends on versions of the software. You, most likely, don't need to do anything with the index file, since after you import it, you can order/sort/index it there using the tools of the target application. I can't recall from the top of my head right now, which of them used to have .ndx for index extension (Clipper? FoxBase? dBase?), but I don't think it was Visual FoxPro. For this reason, I believe that your tables are in a format that is readable by most currently used versions of Excel.
Stella
 
cajuntank,
FoxPro table is that file that have .dbf extension.
Index is the file with .ndx extension.
You can try to go to Excel, File->Open, set FileTypes to dBase(.dbf), and try to open the tables that you have. Chances are, you will be able to do it. Or you can go to Access, and try to Import it from there, it works with .dbf, too.
How big are your .dbf files?
Stella.
 
With the new OLEDB driver available from you can open the table as an ADO recordset if you're familiar with that technique. Then using the VBScrip from Excel you can handle the data accordingly.

I have not used the new OLEDB provider yet, so if other have feel free to elaborate whether this would work or not.

Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top