Article ID: 891775 - View products that this article applies to.
When you create a Microsoft Office Access table that contains long integer numbers and then you export that table as type dBase IV (.dbf), the numbers are converted to double data type and will show decimal places.
For example, you may export the following table:
UNITSWhen you then import and view the data in dBase IV, the data appears similar to the following:
UNITSNote When you create a number field in a table in Access, you use the FieldSize property to control the amount of space that is allocated for a particular field. For number fields, you can choose one of the following numeric types from a list:
This problem occurs because there is no Integer data type in dBase. dBase uses either Numeric or Float data types. Access maps Long Integers to the Numeric data type in dBase.
To work around this problem, use one of the following methods:
Method 1: Modify the database file in dBaseModify the design of the database file after it has been added to the dBase catalog. For example, set the Dec column to 0 (zero). For additional information about designing database files in dBase, see the dBase documentation.
Method 2: Use Microsoft Office Excel to format the dataUse Excel to format the data in the table that you exported. To do this, follow these steps:
Method 3: Use sample code to format the dataMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
You can use the following code sample to automate the process of formatting the data. The sample will save a table as a text file. Then, it will automate Excel to open the text file and then save it in dBase IV format.
Note You must change the file names in this code sample to match your file names.
Contact us for more help
Connect with Answer Desk for expert help.