add/delete dbf record in pascal 
Author Message
 add/delete dbf record in pascal

Hallo Munu2000!

Antwort auf eine Message vom 22.12.1998 08.07.19 von Munu2000 an All:


 M> Hi! I'm trying to add and delete records in database file (*.dbf) but
 M> failed. Could anybody help me in this matter please? Give me a example
 M> source code.T.Q. waiting for answer..... ..

I wrote my own dbase-Unit several years ago. The source code is about 70
pages.

There are several dBase-Units  you can request free. The most popular, I
think, is HALYCON.

Perhaps you only need this information:

dBASE III Database File Structure
The structure of a dBASE III database file is composed of a
header and data records.  The layout is given below.
dBASE III DATABASE FILE HEADER:
+---------+-------------------+---------------------------------+
|  BYTE   |     CONTENTS      |          MEANING                |
+---------+-------------------+---------------------------------+
|  0      |  1 byte           | dBASE III version number        |
|         |                   |  (03H without a .DBT file)      |
|         |                   |  (83H with a .DBT file)         |
+---------+-------------------+---------------------------------+
|  1-3    |  3 bytes          | date of last update             |
|         |                   |  (YY MM DD) in binary format    |
+---------+-------------------+---------------------------------+
|  4-7    |  32 bit number    | number of records in data file  |
+---------+-------------------+---------------------------------+
|  8-9    |  16 bit number    | length of header structure      |
+---------+-------------------+---------------------------------+
|  10-11  |  16 bit number    | length of the record            |
+---------+-------------------+---------------------------------+
|  12-31  |  20 bytes         | reserved bytes (version 1.00)   |
+---------+-------------------+---------------------------------+
|  32-n   |  32 bytes each    | field descriptor array          |
|         |                   |  (see below)                    | --+
+---------+-------------------+---------------------------------+   |
|  n+1    |  1 byte           | 0DH as the field terminator     |   |
+---------+-------------------+---------------------------------+   |
|
|
A FIELD DESCRIPTOR:      <------------------------------------------+
+---------+-------------------+---------------------------------+
|  BYTE   |     CONTENTS      |          MEANING                |
+---------+-------------------+---------------------------------+
|  0-10   |  11 bytes         | field name in ASCII zero-filled |
+---------+-------------------+---------------------------------+
|  11     |  1 byte           | field type in ASCII             |
|         |                   |  (C N L D or M)                 |
+---------+-------------------+---------------------------------+
|  12-15  |  32 bit number    | field data address              |
|         |                   |  (address is set in memory)     |
+---------+-------------------+---------------------------------+
|  16     |  1 byte           | field length in binary          |
+---------+-------------------+---------------------------------+
|  17     |  1 byte           | field decimal count in binary   |
+---------+-------------------+--------------------------------
|  18-31  |  14 bytes         | reserved bytes (version 1.00)   |
+---------+-------------------+---------------------------------+
The data records are layed out as follows:
1. Data records are preceeded by one byte that is a
space (20H) if the record is not deleted and an
asterisk (2AH) if it is deleted.
2. Data fields are packed into records with no field
separators or record terminators.
3. Data types are stored in ASCII format as follows:
DATA TYPE      DATA RECORD STORAGE
---------      --------------------------------------------
Character      (ASCII characters)
Numeric        - . 0 1 2 3 4 5 6 7 8 9
Logical        ? Y y N n T t F f  (? when not initialized)
Memo           (10 digits representing a .DBT block number)
Date           (8 digits in YYYYMMDD format, such as
19840704 for July 4, 1984)

This information came directly from the Ashton-Tate Forum.
It can also be found in the Advanced Programmer's Guide available
from Ashton-Tate.

One slight difference occurs between files created by dBASE III and those
created by dBASE III Plus.  In the earlier files, there is an ASCII NUL
character between the $0D end of header indicator and the start of the
data.
This NUL is no longer present in Plus, making a Plus header one byte
smaller
than an identically structured III file.

Servus, Gottfried!



Sun, 10 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. add/delete dbf record in pascal

2. adding/deleting records from array of records in .dat file

3. Deleted DBF records

4. Deleted Records In DBF

5. help adding and deleting records from arrays

6. DBASE: permanently deleting deleted records

7. add expression index to dbf file

8. Delete the reference to the work-index in a dbf file

9. Quirk: DBF IndexDefs.Add vs. AddIndex

10. Pictures in an dbf file and adding new ones

11. Apollo DBE, Add a field to existing DBF?

12. Adding a Field to DBF Database.

 

 
Powered by phpBB® Forum Software