Dec 112017
See structure of dbf file from dos line.
File DBFSTRU.ZIP from The Programmer’s Corner in
Category Dbase Source Code
See structure of dbf file from dos line.
File Name File Size Zip Size Zip Type
DBFSTRU.COM 9913 6130 deflated
DBFSTRU.DOC 10617 4257 deflated

Download File DBFSTRU.ZIP Here

Contents of the DBFSTRU.DOC file

Display the structure of all dBASE IV, III, II, FoxPro DBF files on disk


Darwin Systems, Inc.
Sysop, Darwin BBS, 301-251-9206


10/03/89 - Version 3.2, Added capability to recognize FoxPro files
(Here's an ad: Watch for my new book called Expert Foxpro:
Advanced Single-User and Multi-User Techniques)

02/24/89 - Version 3.1, Added feature to ignore byte 0 of .dbf file
if program is invoked with the /I switch. This was never
documented except in my DBMS column (anything to make you
subscribe to the "rag", eh?)

02/09/89 - version 3.0
Revised to handle dBASE IV files, including those massaged
in SQL mode. Program can tell you if the dB4 file was
done in SQL, has a production .MDX file, is encrypted, or
was involved in an incomplete transaction (System failure
subjected to ROLLBACK). Also, the program will no longer
force a filetype of .DBF if you include a filetype in the
file specification.

BTW, Appendix E of the dBASE IV 1.0 manual has INCORRECT
information on the first byte of the DBF structure. See
my column in DBMS magazine (called Set Expert On)

Revisions to companion programs DBNDXPO and LISTFPO to
handle dBASE IV will be out real soon now.

08/16/86 - version 2.1
Corrects a bug where the program aborted with a message
'File not found' after it has processed about 20 files.
While I was at it, I shranked the code a few thousand bytes
more. If you find any more bugs, let me know and I'll try to
learn C before I program with it any more (heh, heh).

05/29/86 - Complete rewrite of the program in Lattice C v 2.04
- Now lists structure of both dBASE II and dBASE III
files on disk. Program knows automatically which is
which. dBase II files will have a note "*dBASE II*" on
the header line of output.
- Output identical to dBASE III's LIST STRUCTURE command

05/23/86 - Version 1.1
Fixed bug related to dBASE III header file fooling us
if the file came from Ashton-Tate's dCONVERT utility

02/07/86 - DBSTRUPO version 1, first release


DBSTRUPO allows you to display the structure of all dBASE IV, dBASE
III, dBASE II and FoxPro data files on a given disk or subdirectory
with a single command invocation. It recognizes all dBASE DBF
files created by all versions of dBASE, all dBASE compilers and
add-on products. The structure listings may be redirected to the
printer or to a file. Redirecting the output to a file
gives you the flexibility of including the data in your system

You don't need dBASE to run this program. In fact, most
people will run this program in DOS. However, you may also
execute the program from within dBASE via the dBASE RUN (or !)


The alternative is to go to dBASE, USE for each of your
databases, SET ALTERNATE TO , SET ALTE ON, then do
LIST STRU, then finally, CLOSE ALTE or QUIT. If you have dBASE II
files, you get out, then do a similar procedure. That can be a pain,
even with one DBF file.

I use this program to list the structure of all DBF's related to
a given application, then include the redirected output in the
MAIN PRG file as internal documentation. I include the same data
in the system's printed documentation. I also use the program to
do a quick check on a DBF structure without having to bother
loading dBASE II, III or IV or FoxPro.


DBSTRUPO [drive\path\ambiguous-filename] [>dosdev]

You may specify drive, path, any wildcard filenames, all of these
or none of these. How's that for taking care of everything you want?

You may redirect the output to "dosdev" which is any valid DOS
device, for example, PRN, or any file you name.


1. Example 1


All the above examples will display the structure of all DBF
files on the C:\DB subdirectory and redirect the output to the file
A:MYDOC.TXT. If A:MYDOC.TXT already exists, it will be overwritten.

2. Example 2


will display the structure of all DBF files on the current
directory to the screen only.

3. Example 3


Either command will display the structure of all DBF files whose
filenames begin with "T" on the default directory to the printer.

4. Example 4


will list the structure of all DBF files on C: which you renamed
to have a filetype of .FIL. They MUST be dBASE data files.

5. Example 5


(This is your quiz. If you've been paying attention, you should know
what this command does).


If TEST.DBF, TEST2.DBF and TEST4.DBF are the only DBF files on the
subdirectory, D:\TEMP\, and you are logged into that subdirectory,
then each of the folowing commands:


will produce the following output:

Structure for database : D:\TEMP\TEST4.DBF *dBASE IV - SQL*
Number of data records : 0

Date of last update : 2/11/89
Field Field Name Type Width Dec
1 F_CHAR Character 15
2 F_DATE Date 8
3 F_FLOAT Float 10 2
4 F_NUMBER Numeric 8 1
5 F_LOGICAL Logical 1
6 F_MEMO Memo 10
** Total ** 53

-- File in incomplete transaction
-- File is encrypted
-- File has production .MDX

Structure for database : D:\TEMP\TEST.DBF
Number of data records : 0
Date of last update : 5/29/86
Field Field Name Type Width Dec
1 NAME Character 25
2 AGE Numeric 3
3 SALARY Numeric 10 2
4 BIGNUM Numeric 12 10
5 DOB Date 8
6 T_F Logical 1
7 NOTE Memo 10
** Total ** 70

Structure for database : D:\TEMP\TEST2.DBF *dBASE II*
Number of data records : 0
Date of last update : 5/29/86
Field Field Name Type Width Dec
1 NAME Character 40
2 AGE Numeric 3
3 SALARY Numeric 14 10
4 T:F Logical 1
** Total ** 59

Note that the TOTAL value is one more than the sum of the Width
column entries. The extra byte is due to the dBASE delete flag.


Many years ago, I started looking at C while I was working with
CP/M. I bought a bunch of compilers but never got around to really
using them, because I could do everything I wanted to do with
BASIC, PL/1, FORTRAN, dBASE, 8080 Assembler and (shudder!) COBOL.

In 1986, I was vacationing in Key West (Florida is my favorite state,
having gone to school in Gainesville) and promptly got sick. Luckily,
I brought with me the C Primer Plus book by Waite and started
studying the language then. Although I learned all computer languages
on my own (usually from IBM mainframe manuals), I can say that C is
by far the hardest language for me to learn (that could also be
because my brain has deteriorated now). While I learned PL/1 from IBM
manuals in 3 days, ADA for CP/M in 2 days, it took me about a week to
get going in C.

Now people ask me what is the best way to learn C. I really don't
know, but all I did was read Waite's book, then looked at a bunch
of C programs in the public domain from my BBS. Without these PD
programs, I am sure I'd have a heck of a time. Thus, I want to
thank the following people whose programs I used to learn and
write DBSTRUPO: Ross Nelson, Tony Movson, David Purks.

DBSTRUPO.C probably is not the best example of C code. It is my
first real C program, after all. If I have the time I will clean
it up a bit and release the source code to the public domain.

Since I am still learning, I would like to request the C gurus out
there and other callers with good examples of C codes to please
send them to my BBS. For those who still program in BASIC and
others, I want to say that C is fantastic, compiles and executes
fast and produces much smaller EXE file. I leave you Anthony's Law
of Force: "Don't force it; get a larger hammer."


DBSTRUPO is copyrighted by me, but you may use or distribute it
freely subject to the following conditions:

1. Both DBSTRUPO.COM and DBSTRUPO.DOC (this file) are distributed

2. Neither file is altered in any way. If you want to alter files,
write your own.

3. You don't charge anything for distributing this program. I am
giving this to you for free, so you do the same.

All monetary contributions for this program are graciously
declined. If you really like me that much, buy my other programs such
as the Dr. Dbase Utilities, featuring:

MEMOPAK - all kinds of memo field utilities for dBASE III/IV and
later, FoxPro.

NETPAK - Convert single-user to multiuser code, implement transaction
processing on Novell for the Dbase family of products, more.

Call 301-251-0497 for more info, or write to:
Dr. Dbase Utilities
Darwin Systems, Inc.
17 Thorburn Road
Gaithersburg, MD 20878

 December 11, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>