home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / bit / listserv / dbasel / 772 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  2.6 KB

  1. Path: sparky!uunet!mcsun!uknet!ox-prg!oxuniv!hsr4
  2. From: hsr4@vax.oxford.ac.uk
  3. Newsgroups: bit.listserv.dbase-l
  4. Subject: Re: Dbase 3 / 3+
  5. Message-ID: <1992Jul29.143133.7887@vax.oxford.ac.uk>
  6. Date: 29 Jul 92 13:31:33 GMT
  7. References: <9207241830.A03431@ius.indiana.edu>
  8. Organization: Oxford University VAXcluster
  9. Lines: 55
  10.  
  11. In article <9207241830.A03431@ius.indiana.edu>, rboyer2@IUS.INDIANA.EDU (RBOYER2) writes:
  12. > :Can someone tell me where I can find the file format description of a Dbase
  13. > :          3 / 3+ database file ?
  14. > :Thanks
  15. > :
  16. > :Davei (davei@lancaster.ac.uk)
  17. >           I've been meaning to look these things up for a long time
  18. >           now and just decided I would.  They are listed in the
  19. >           Appendix-D of my dBase III+ manual.  I'll copy them here for
  20. >           you poor souls without the manual handy.
  21.  
  22. And they also appear in Appendix C of the Using dBASE III PLUS manual.
  23.  
  24. >           Structure of a Database File Header:
  25. >           Byte
  26. >           Offset   Contents           Meaning
  27. >           ==========================================================
  28. >           0        1 byte             dBase III version number
  29. >                                         (03H without a .dbt file)
  30. >                                         (83H with a .dbt file)
  31. >           1-3      3 bytes            date of last update
  32. >                                         (YY MM DD)
  33. >           4-7      32 bit number      number of records in data file
  34.  
  35. [etc]
  36.  
  37. I too have been looking for details of file structures, but with much finer
  38. detail than is given in the handbooks.  For example, exactly how to interpret
  39. the values, and what normal ranges might be expected.
  40.  
  41. I'm slowly finding time to work things through, so I can't give fine detail yet
  42. (but give me time...).
  43.  
  44. One thing which has become apparent is that the 32 bit number which lies in
  45. offset bytes 4-7 doesn't translate as it stands.  For example, when I look at
  46. one of my (problem) .dbf files, the hex values for bytes 4-7 are 3F 91 01 00.
  47. The direct conversion of that number to decimal gives 1,066,467,584 - which
  48. isn't the number of known records in the file!
  49.  
  50. What appears to be necessary is to reverse the sequence of the bytes - so
  51. 3F 91 01 00 becomes 00 01 91 3F, which turns out to be decimal 102,719 (and
  52. which also happily is the number of known records in the file).
  53.  
  54. For some this might be glaringly obvious, but not for others (like me, with 
  55. debugging experience primarily in Texas Instruments environment!).
  56.  
  57. There may be others lurking.  If I find anything really tortuous, I'll let you
  58. know...
  59.  
  60. Peter "Hair regrowing nicely, thanks" Brooks
  61.