home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / DBBROW20.ZIP / DBASEBRO.DOC next >
Encoding:
Text File  |  1988-05-23  |  6.6 KB  |  225 lines

  1.                        Dbase III DBF File Structure
  2.  
  3.  
  4. Header
  5. ------
  6.  
  7.  
  8.     
  9. BYTE #        Type        Example       Description
  10. ------        ----            -------           -----------
  11.     
  12. 0        Byte           1              DBASE Version
  13.                                                   (83H with DBT file)
  14.                                                   (03H without DBT file)
  15.  
  16. 1        Byte           2              Year - Binary
  17.  
  18. 2        Byte           3              Month - Binary
  19.  
  20. 3               Byte           4              Day - Binary
  21.  
  22. 4-7        32 bit integer     5              Number of records in file
  23.  
  24. 8-9        16 bit integer       6              Length of header
  25.  
  26. 10-11        16 bit integer     7              Length of record
  27.  
  28. 12-31        20 Bytes       8              Reserved
  29.  
  30. 32-n        32 Bytes                  Field Descriptor
  31.                               (See below)
  32.                     
  33. n+1        Byte               9              0Dh field terminator
  34.  
  35. N+2          Byte              10              00h In some older versions
  36.                                   (The length of header byte
  37.                                                   reflects this if present)
  38. .pa
  39.  
  40. Field Descriptor
  41. ----------------
  42.  
  43. BYTE #        Type        Example       Description
  44. ------        ----            -------           -----------
  45.  
  46. 0-10        byte           11             Field name 
  47.                               (Zero filled)
  48.  
  49. 11        Byte           12              Field Type
  50.                               (N D L C M)
  51.  
  52. 12-15        32 bit integer       13              Field data address
  53.                               (Internal use)
  54.  
  55. 16        Byte           14              Field length - Binary
  56.  
  57. 17        Byte           15              Field decimal count - Binary
  58.  
  59. 18-31        14 bytes       16              Reserved
  60.  
  61.  
  62.  
  63. Field Types
  64. -----------
  65.  
  66.  
  67. N    Numeric - 0 1 2 3 4 5 6 7 8 . -
  68.  
  69.  
  70. D    Date - 8 Bytes (YYYYMMDD)
  71.  
  72.  
  73. L    Logical - Y y N n T t F f ? (? = Not initialized)
  74.  
  75.  
  76. C    Character - Any Ascii Character
  77.  
  78.  
  79. M    Memo - 10 digits (DBT block Number)
  80.  
  81.  
  82.  
  83. Data Records
  84. ------------
  85.  
  86.  
  87.     All data is in Ascii.
  88.  
  89.  
  90.     There is no field seperators or record terminators.
  91.  
  92.     The first byte is a space (20h) if record not deleted and an     
  93.     asterick (2AH) if deleted.
  94.  
  95.  
  96.  
  97. DBASE Limitations
  98. -----------------
  99.  
  100. Fields - 128 Max.
  101.  
  102. Record - 4000 bytes Max.
  103.  
  104. Header - 4130 bytes Max.
  105.  
  106.       (128 Fields * 32 bytes) + 32 bytes + 1 terminator + (1 null)
  107.  
  108. Number - 19 digits
  109.  
  110.  
  111.  
  112.  
  113. Example File
  114. ------------
  115.  
  116.  
  117.          1  2  3  4     5         6     7          8
  118.         || || || || |---------| |---| |---| |---------- 
  119. 000000  83 55 0B 0E 31 00 00 00-81 01 89 00 00 00 00 00  .U..1...........
  120.  
  121.         ----------------------------------------------|
  122. 000010  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
  123.  
  124.                       11                 12     13
  125.         |------------------------------| || |---------| 
  126. 000020  46 49 52 53 54 4E 41 4D-45 00 00 43 13 01 9D 41  FIRSTNAME..C...A
  127.  
  128.         14 15                     16
  129.         || || |---------------------------------------|
  130. 000030  14 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  131.  
  132. 000040  4C 41 53 54 4E 41 4D 45-00 00 00 43 27 01 9D 41  LASTNAME...C'..A
  133.  
  134. 000050  14 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  135.  
  136. 000060  50 48 4F 4E 45 00 00 00-00 00 00 43 3B 01 9D 41  PHONE......C;..A
  137.  
  138. 000070  0D 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  139.  
  140. 000080  54 52 41 56 45 4C 43 4F-44 45 00 43 48 01 9D 41  TRAVELCODE.CH..A
  141.  
  142. 000090  04 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  143.  
  144. 0000A0  54 52 41 56 45 4C 50 4C-41 4E 00 43 4C 01 9D 41  TRAVELPLAN.CL..A
  145.  
  146. 0000B0  28 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  (...............
  147.  
  148. 0000C0  44 45 50 41 52 54 55 52-45 00 00 44 74 01 9D 41  DEPARTURE..Dt..A
  149.  
  150. 0000D0  08 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  151.  
  152. 0000E0  43 4F 53 54 00 50 41 49-44 00 00 4E 7C 01 9D 41  COST.PAID..N|..A
  153.  
  154. 0000F0  0A 02 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  155.  
  156. 000100  50 41 49 44 00 4F 54 45-53 00 00 4C 86 01 9D 41  PAID.OTES..L...A
  157.  
  158. 000110  01 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  159.  
  160. 000120  41 47 45 4E 54 00 00 00-00 00 00 43 87 01 9D 41  AGENT......C...A
  161.  
  162. 000130  02 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  163.  
  164. 000140  52 45 53 45 52 56 44 41-54 45 00 44 89 01 9D 41  RESERVDATE.D...A
  165.  
  166. 000150  08 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  167.  
  168. 000160  4E 4F 54 45 53 00 00 00-00 00 00 4D 91 01 9D 41  NOTES......M...A
  169.  
  170. 000170  0A 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  ................
  171.  
  172.                 Firstname
  173.            || |----------------------------------------
  174. 000180  0D 20 43 6C 61 69 72 65-20 20 20 20 20 20 20 20  . Claire        
  175.                            
  176.                             Lastname
  177.         ----------------| |----------------------------
  178. 000190  20 20 20 20 20 20 42 75-63 6B 6D 61 6E 20 20 20        Buckman   
  179.  
  180.                                         Phone
  181.         ----------------------------| |----------------
  182. 0001A0  20 20 20 20 20 20 20 20-20 20 28 35 35 35 29 34            (555)4
  183.  
  184.                                T - code     T - plan
  185.         -------------------| |---------| |-------------
  186. 0001B0  35 36 2D 39 30 35 39 43-49 31 30 31 30 2D 6E 69  56-9059CI1010-ni
  187.  
  188.         -----------------------------------------------
  189. 0001C0  67 68 74 20 43 61 72 69-62 62 65 61 6E 20 49 73  ght Caribbean Is
  190.  
  191.         -----------------------------------------------
  192. 0001D0  6C 61 6E 64 20 43 72 75-69 73 65 20 20 20 20 20  land Cruise     
  193.  
  194.                    Departure Date          Cost
  195.         -------| |---------------------| |-------------                  
  196. 0001E0  20 20 20 31 39 38 35 31-30 32 34 20 20 20 31 31     19851024   11
  197.  
  198.                        PD  Age    Res. Date
  199.         -------------| || |---| |---------------------|
  200. 0001F0  39 39 2E 30 30 54 4D 4D-31 39 38 35 30 37 31 35  99.00TMM19850715
  201.  
  202. .pa
  203.             Notes
  204.         |---------------------------|
  205. 000200  20 20 20 20 20 20 20 20-20 31 20 52 69 63 6B 20           1 Rick 
  206.  
  207. 000210  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 4C                 L
  208.  
  209. 000220  69 73 62 6F 6E 6E 20 20-20 20 20 20 20 20 20 20  isbonn          
  210.  
  211. 000230  20 20 20 28 35 35 35 29-34 35 35 2D 33 33 34 34     (555)455-3344
  212.  
  213. 000240  41 56 31 30 39 2D 6E 69-67 68 74 20 41 6C 61 73  AV109-night Alas
  214.  
  215. 000250  6B 61 2F 56 61 6E 63 6F-75 76 65 72 20 43 72 75  ka/Vancouver Cru
  216.  
  217. 000260  69 73 65 20 20 20 20 20-20 20 20 20 31 39 38 35  ise         1985
  218.  
  219. 000270  30 38 30 35 20 20 20 31-33 37 38 2E 30 30 54 4A  0805   1378.00TJ
  220.  
  221. 000280  54 31 39 38 35 30 37 31-35 20 20 20 20 20 20 20  T19850715       
  222.  
  223. 000290  20 20 32 20 48 61 6E 6B-20 20 20 20 20 20 20 20    2 Hank        
  224.  
  225.