Using dBASE III PLUS on DBFs after 01 January 2001

If you are using dBASE III PLUS on DBF files, in conjunction with other Xbase products, you may encounter an error in opening the file after 01 Jan 2001. What happens is that the year information "date last updated" information in the DBF header is handled differently between dBASE III PLUS and older products. Once the DBF is opened by another product, the "date last updated" information is written in such a way that dBASE III PLUS cannot recognize it, and therefore cannot open the file.

Alan Dechert has provided a workaround for this problem in his postings on the dBASE newsgroups. The following code will rewrite the header information so that the file can be opened again by dBASE III PLUS:

*********
clear
fname = space(12)
@11,12 say "Enter filename with .dbf extension"
@12,12 get fname
read

n=fopen("&fname","rw")
? fseek(n,1)
? fwrite(n,chr(99))
? fclose(n)
********* end prg

A compiled version of this code can be found here. Copy the EXE to the directory containing the files needing repair. Include the .DBF extension when the program prompts for the name of the file to be repaired.

Note: use this at your own risk. MAKE BACKUPS before performing any operation on the header of your data files.

This remedy is intended for one-time or infrequent repair. If you need on-going corrections within your application, download the fix from Henrik Rosenberg at http://jonasmork.host56.com/db2000uk.htm and follow the instructions for modifying your application.