I'm trying to update a dBase IV DBF file, and having some problems; it appears that the header is incorrect after the update. The update code is:
DBF dbfConn = new DBF(dbfFilename);
int fieldCount = dbfConn.getFieldCount();
Field dbfFields = new Field[fieldCount];
for (int i = 1; i <= fieldCount; i++)
dbfFields[i - 1] = dbfConn.getField(i);
for (Vector tableDataRow : dataRows)
for (int i = 0; i < fieldCount; i++)
The header is corrupt after the update completes, it seems as if the new header is written at the end of the existing header, but I'm not certain. For my current testing purposes I'm just using String and numeric data so the Field.put(String) call works as expected. No other process has a handle to the file. I'm limited to updating the file in place rather than deleting and recreating it.
Need more information, Can you supply the original and the resultant dbf files.