LOGO

dBase III+

Philip J. Erdelsky

September 15, 2015

Please e-mail comments, corrections and additions to the webmaster at pje@efgh.com.

1. Introduction

Many years ago, when MS-DOS was the operating system used by most personal computers and many of them used floppy diskettes for data storage, the most popular database program was dBase.

I bought dBase III+ in 1988 for $423.99. That seemed to be rather expensive at the time, but I certainly got my money's worth. I used it for all of my rather modest database processing needs, and I have kept on using it, transferring it to a newer computer every few years.

Of course, when Windows came along, I had to run dBase in a DOS window. But that was easy to do, and it kept getting faster with improved computer hardware. Although it wasn't the latest technology, it continued to fill all my database processing needs.

With the introduction of Windows 7 a few years ago, progress seemed to stop. Although Windows 7 has a DOS window, it does not run so-called "16-bit" programs, such as dBase III+. A pop-up screen advises users to contact their software vendor for a newer "32-bit" version.

There is no later version of dBase, or at least none that I could find.

Current database programs can read and write dBase files, fortunately.

Although the DOS window in Windows 7 doesn't run 16-bit programs, there is a special utility called DOSBox that runs under Windows 7 and emulates DOS. It was written mainly to handle DOS games, but it runs dBase III+ quite well. DOSBox is totally free of charge and OpenSource. It can be downloaded from the website at www.dosbox.com.

Emulation is rather inefficient. Some dBase III+ programs run rather slowly under DOSBox. In some cases, it's like going back to the old floppy-based computing.

I am a retired computer programmer, and I still do some programming, mostly in Borland C++, for my own use. So I wrote a package that accesses dBase III+ files. I use DOSBox for manual access to dBase III+ files, but I program access in C++. It runs much, much faster.

There are some features of dBase III+ that I've never used, such as memo files and relational databases. I've rarely used indexing. I don't need it for my database tables, which rarely have more than a few hundred records.

2. Using DOSBox

It is quite easy to install dBase III+, because it was developed before the era of complex computer systems. Because of its 16-bit origin, all file names must conform to the old "8.3" standard, with a name no more than 8 characters long, a single extension no more than 3 characters long, and no spaces or other special characters in either the name or extension.

I created a directory C:\DOS16 to hold dBase III+ and other old 16-bit programs. The files associated with dBase III+ are

     DBASE.EXE
     DBASE.OVL
     DBASE.MSG
     DBASEINL.OVL
     HELP.DBS
     CONFIG.DB
In most cases, they can be copied from one system to another with no change. The file CONFIG.DB contains dBase commands to be executed by dBase when it is launched. It may be omitted if the default configuration is satisfactory.

Another directory is used to hold the dBase III+ data files. I use a directory called DB, positioned as a subdirectory of the application in use. For example, C:\MailingList\DB. Intermediate directory names don't have to conform to the 8.3 standard, because DOSBox never sees them. However, embedded spaces can cause difficulties.

We complete the emulation by launching DOSBox.exe with a few command-line arguments. It is best to use a batch (.BAT) file for this purpose. In our example, the contents of the batch file are essentially as follows, but with all items on a single line:

   "C:\Program Files (x86)\DOSBox-0.74\DOSBox.exe"
     -c "MOUNT C C:\MailingList\DB"
     -c "MOUNT D C:\DOS16"
     -c C:
     -c "PATH D:"
     -c DBASE
     -userconf
This launches DOSBox in a virtual machine with two drives. Drive C: is the working directory, which contains all the dBase data files, and drive D: is the utility directory. It then launches dBase in this environment.

Exit from dBase is by the usual QUIT command, which moves control to the working directory. The EXIT command will then return control to the DOS window from which DOSBox was launched.

3. Programming in C++

I use Borland C/C++ 5, which is a 32-bit version that still runs under Windows 7, or at least the command-line version still runs. It apparently uses the @?&*!! Windows Registry, so it must be installed in order to run properly.

The access package resides in the file dbftable.obj, which was compiled from the source file dbftable.cpp, with the included header file dbftable.h.

A number of command-line and GUI utilities have been compiled with the access package.

A makefile is used to compile the package and utilites, and documentation is provided in two text files.

These are the files for the package and command-line utilities:

dbftable.txtProgramming Manual
dbase3.txt dBase III+ file format
dbftable.h Header file
dbftable.objPackage object code
dbftable.cppPackage source code
dbfpack.exe Packing utility
dbfpack.cpp Source code for dbfpack.exe
dbfsort.exe Sorting utility
dbfsort.cpp Source code for dbfsort.exe
dbfcreate.exe Table creation utility
dbfcreate.cpp Source code for dbfcreate.exe
dbfcopystruct.exe Structure copy utility
dbfcopystruct.cpp Source code for dbfcopystruct.exe
dbflist.exe Listing utility
dbflist.cpp Source code for dbflist.exe
dbfstruct.exe Structure display utility
dbfstruct.cpp Source code for dbfstruct.exe
dbfappendblank.exe Append blank record utility
dbfappendblank.cpp Source code for dbfappendblank.exe
dbfzero2blank.exe Zero-to-blank utility
dbfzero2blank.cpp Source code for dbfzero2blank.exe
dbf2html.exe HTML conversion utility
dbf2html.cpp Source code for dbf2html.exe
makefile makefile for all utilities

There is also a GUI utility that can be used to edit a DBF file. Notice that the source code for this utility includes a header, an icon and a resource file, in addition to the usual C++ source file. Here are the files for that utility:

editdbf.exeUtility executable
editdbf.cppSource code for editdbf.exe
editdbf.hSource code for editdbf.exe
editdbf.rcSource code (resource) for editdbf.exe
db3.icoSource code (icon) for editdbf.exe