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

convert dbase tables to ACCESS

Status
Not open for further replies.

ldessne

Technical User
Oct 19, 2002
3
0
0
US
ACCESS (XP) readily converts DBASE III+ and IV Tables, but the resultant tables in ACCESS have fewer records than they DBASE tables. This causes havoc with related tables. I suspect the problem is with incomplete records in DBASE, but that suspicion does lead me to a solution. Thanks for your help.
Larry Dessner
 
I'm not quite sure what you're trying to ask for help with, but:

If you have Nulls not allowed in fields in the Access tables and some records in the dBase dbf have that field empty, Access will not create the records on the import. The same is true if you have incompatible data types defined between the Access/dBase tables and some of the dBase records contain data that results in a data type mismatch (ie. character field to numeric where some of the dBase records have alpha chars in that field).

Or do you understand how/why the records didn't get created and are looking for help in how to recover from the havoc generated in related tables?

 
Much thanks for your post. I imported the dbase table into a new ACCESS table: fewer records in ACCESS. Then I massaged a blank ACCESS table to make sure that null records would be allowed: same result. I have given up. My brother's charitable foundation will have to continue using DBASE for all I can do to help. Larry Dessner
 
Work around:
1) Export file to CSV from dBase
2) Import the CSV file to Access

dBase commands:
use mytable order myindex noupdate
copy to myfile_path.csv type csv
use
quit

Access is self explanitory.

Hope this helps.
 
Yeah I was going to say send the data from dbase into a .txt file and then do GET EXTERNAL DATA - FIXED WIDTH - SPECIFICATION within ACCESS and point to the .txt file. You know how to do that?

Once in you can import any kind of field from .txt.

 
i am faced with a silimar issue.. however, i have a program that will output a dbase file.. but its a list of properties that the agency would like to update once a week. The other methods of getting the information from this program 'dont' work. I could export it to a fixed length txt.. but no it wont do it. So I have a dBase file to start with.

My problem is that I have to teach someone who isn't .. well .. gifted with computers to do this once I figure it out. Is there any way of getting some type of automation to this process? IE a little app that reads that database and then gives me a csv or fixed length file.. or pulls it right into access???

ALSO.. i see you executing commands to that database.. what program do i need for that?
 
Thanks to those who have helped. No matter how I import the dbase table into ACCESS, the access table has fewer records. If I clean up the DBASE file, removing blank records, I will surely screw up the relationship between it and the organization's other file. Other than fixing the dbase problems by hand--there are thousands of records--I can do nothing. So I have surrendered.
Larry Dessner
 
I'm trying to convert dbase files automatically to any other format also. I'd love to be able to get the data as csv or tab delimited. I found some perl modules to do it (codebase is one, dbd::xbase the other). One (codebase) requires the codebase libraries from sequiter software (yuck, I don't want to have to buy anything). The other might work - dbd::xbase is going to be my next shot.

Just a clue. You might want to try and look up these as options. Someone also might want to write a converter and put it up on sourceforge.net so everyone can use it. It should be open source if possible so people can maintain it and not worry about embedded viruses.
 
Not sure exactly what you're looking for, but if you have dBase and want to output programmatically to a tab delimited file, the syntax is:

USE MyTable
COPY TO MyTextFile.txt DELIMITED WITH TAB

But I think I hear you looking for something to convert w/o using dBase. You can open .dbf (dBase table files)directly, depending on the version, using Microsoft Excel/Access if that's any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top