Data in narrow columns truncated when saving as DBF

B

Ben Amada

I have a requirement to save some data in an Excel file in DBF format which
Excel can do. However I noticed that if the columns in Excel are not wide
enough, the data in the columns is truncated when I re-open the DBF file in
Excel. It's also truncated when I open the DBF file with this other 3rd
party application. Please note that the amount of text in each column is
not that much -- maybe 15-25 characters.

I have to re-type the data, expand the columns to be wider than the actual
data (so the data is completely visible and then some), then re-save the
file in DBF format.

Does anyone know why Excel truncates the data when the columns aren't wide
enough?? This seems ridiculous that Excel would do that. Also, is there
any setting or option in Excel to prevent this from happening?

Thank you,
Ben
 
D

Dave O

Just a guess here: when I create a table in Access I can specify field
width for my entries. Is it possible the field width in your DBF file
is set to some default value that is comparitively low?

I just tested this by saving some Excel text as a DBF (DBase IV
format). The only database program I have on this computer is Access,
so I opened the DBF file using Access and found the file width to be 9
characters- but I couldn't alter the field width because Access had
attached the data rather than import it. Do you have software that can
alter the field width?
 
B

Ben Amada

Dave said:
Just a guess here: when I create a table in Access I can specify field
width for my entries. Is it possible the field width in your DBF file
is set to some default value that is comparitively low?

I just tested this by saving some Excel text as a DBF (DBase IV
format). The only database program I have on this computer is Access,
so I opened the DBF file using Access and found the file width to be 9
characters- but I couldn't alter the field width because Access had
attached the data rather than import it. Do you have software that can
alter the field width?

Hello Dave,

Thanks for testing that out. I do have Access although I generally don't
use it.

I was able to create a new database in Access, import the Excel file into
Access and then Export the data from Access to a DBF file. Also, since I
imported the data (rather than "attach" it), Access allowed me to alter the
field lengths although it wasn't necessary since when I import the data,
Access must automatically detect the longest field of data and set the field
length to that value.

In short, your idea of using Access got me on the right track!

Thanks again,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top