home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / dbtchk.zip / DBTCHECK.DOC next >
Text File  |  1990-08-06  |  11KB  |  331 lines

  1.  
  2.  
  3.                              DBTCHECK DOC - August 1990
  4.  
  5.  
  6.  
  7.           DBTCHECK
  8.           August 1990
  9.           Erik A McBeth
  10.  
  11.                                      INTRODUCTION
  12.  
  13.  
  14.                DBTCHECK is designed to help in the fixing and diagnosing of
  15.           dBASE memo problems in both dBASE III, III+ and IV.  Many common
  16.           memo problems can be fixed by DBTCHECK and its strength lies in
  17.           its simplicity and speed.  DBTCHECK is NOT intended to fix severe
  18.           data corruption in memos, but fortunately most memo problems are
  19.           related to factors outside of the data itself.  Neither 
  20.           Ashton-Tate nor its author assumes ANY responsibility for damages
  21.           incurred as a result of using DBTCHECK.  There is no guarantee
  22.           that your data will be set right, always RUN THE PROGRAM ON
  23.           BACKUP DATA.
  24.                
  25.                DBTCHECK will help with the following problems:
  26.  
  27.           1)  Memo marker staying uppercase after deleting all the data.
  28.           2)  "Disk full" errors when saving/accessing memos.
  29.           3)  Memo (DBT) files growing to extreme size during dBASE copy
  30.               operations.
  31.  
  32.                In general, after running DBTCHECK and fixing any errors,
  33.           you'll want to load dBASE and do the following:
  34.                     
  35.                     USE file
  36.                     COPY TO temp
  37.                     ZAP  (erases all records, do you have a backup file?) 
  38.                     APPEND FROM temp
  39.  
  40.           This should help to shrink the DBT file and also reset any memo
  41.           markers in the DBF file.
  42.  
  43.                This copy operation could also be accomplished by using a
  44.           utility (developed by the author) called DBTCNVT which "packs"
  45.           memo fields and will even allow you to optimize memo operations.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                    DBTCHECK INTRO
  65.  
  66.  
  67.  
  68.  
  69.                              DBTCHECK DOC - August 1990
  70.  
  71.  
  72.  
  73.                                    DBTCHECK SYNTAX
  74.  
  75.  
  76.           DBTCHECK dbf_file [/F /T /B /I /S /L /X /O /3 /4 /Rx /Jx]
  77.           where:
  78.  
  79.           dbf_file    = the dBASE file you want checked
  80.  
  81.           /F          = Fix the errors in the dbF only. These errors
  82.                         include deleted or lost blocks and version byte.
  83.                                                 
  84.           /T          = Fix the errors in the dbT only.  These errors
  85.                         include "too big" memos and wrong blocksize.  When
  86.                         guessing the size of "too big" memos a guess of
  87.                         blocksize-8 or 512-8=504 should be OK.
  88.                 
  89.           /B          = Performs both the /F and /T parameters.
  90.  
  91.           /I          = Show Information on all records with memos.
  92.                         DBTCHECK usually only shows information on a record
  93.                         when errors are found.
  94.  
  95.           /S          = Speed mode, in this mode only lost memo blocks can
  96.                         be checked and cleaned up.
  97.  
  98.           /Lx         = Set block number Limit or threshold.  If you
  99.                         suspect that a block number is out of range and
  100.                         DBTCHECK is not marking it as such then you can use
  101.                         this parameter.  /L1234 would set the threshold at
  102.                         1234, all memos with pointers greater than or equal
  103.                         to this will be considered "lost."  
  104.  
  105.           /X          = Perform eXtensive testing, test for duplicate and
  106.                         overlapping blocks.  In order to accomplish this
  107.                         two files (_BLOCKS.DBF and _BLOCKS.NDX) must be
  108.                         created in the current drive.  Info on each memo
  109.                         takes up about 40 bytes.  This operation can be
  110.                         slow, but is much faster than earlier versions of
  111.                         DBTCHECK.
  112.  
  113.           /O          = Show information on all records with memos but in
  114.                         block number, as opposed to record number, order. 
  115.                         See /X above for info regarding diskspace.
  116.  
  117.           /3          = Force the opening of the file as a dBASE III type
  118.                         memo file.  If we also specify the parameter /F (or
  119.                         /B) then the version byte in the dbf file will also
  120.                         be set.
  121.  
  122.           /4          = Force the opening of the file as a dBASE IV type
  123.                         memo file.  If we also specify the parameter /F (or
  124.                         /B) then the version byte in the dbf file will also
  125.                         be set.
  126.  
  127.  
  128.  
  129.  
  130.                                    DBTCHECK SYNTAX
  131.  
  132.  
  133.  
  134.  
  135.                              DBTCHECK DOC - August 1990
  136.  
  137.  
  138.  
  139.           /Rx         = Read the memo file using a block size of x bytes. 
  140.                         Use this if you suspect that the blocksize in the
  141.                         memo header has become corrupted.  If you also
  142.                         specify the parameter /T (or /B) then this
  143.                         blocksize will be written to the memo header.
  144.  
  145.           /Jx         = Jump to record x to start the analysis/fixup.  This
  146.                         is handy if you suspect that the corrupt memos
  147.                         start toward the end of the file.
  148.  
  149.  
  150.           all parameters besides the file name are optional, DBTCHECK will
  151.           NOT fix a file unless you tell it to.
  152.  
  153.           EX:
  154.  
  155.                  DBTCHECK tester
  156.  
  157.           we want DBTCHECK to check for errors in the dBASE data file 
  158.           TESTER.DBF.  DBTCHECK will only report problems, not fix them.  
  159.  
  160.                  DBTCHECK tester /B
  161.                    
  162.           This will cleanup errors found in both the data and memo file.
  163.  
  164.           Hint:  the headers of the DBF and DBT files are corrected first,
  165.           before any other file operations (except looking for free blocks)
  166.           and if that is all you need fixed then you might try something
  167.           like this:
  168.  
  169.                  DBTCHECK tester /B /4 /R512 /J100
  170.  
  171.           This would set the DBF version byte to look for dBASE IV memos,
  172.           the block size in the DBT to be 512 bytes, and the next available
  173.           block number in the DBT to be end-of-file.  We use the /J
  174.           parameter to jump to a record number far down field so we don't
  175.           have to wade through all the memos.  This is of course only an
  176.           example and your specific needs in changing the file headers
  177.           would probably be different.
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                    DBTCHECK SYNTAX
  197.  
  198.  
  199.  
  200.  
  201.                              DBTCHECK DOC - August 1990
  202.  
  203.  
  204.  
  205.                                DBTCHECK ERROR MESSAGES
  206.  
  207.                       Explanation of errors which occur with memos.
  208.  
  209.           Deleted   - Memo block deleted, DBF marker points to a memo
  210.                       which has been deleted or has a length of zero.  Fix
  211.                       with /F or /B parameter.
  212.  
  213.           Lost      - Memo block doesn't exist, DBF marker points beyond
  214.                       the end of the file.  Fix with /F or /B parameter.
  215.  
  216.           Too big   - Memo is too big, the memo either has a length
  217.                       greater than the size of the file or the end of file
  218.                       marker was never found in this memo.  You must run
  219.                       DBTCHECK with the /T or /B parameter in order to
  220.                       cleanup this sort of error.  You will be asked to
  221.                       provide the memo lengths of these huge memos.
  222.                       Guessing a number too high could destroy information
  223.                       in subsequent memos - USE WITH CAUTION!  (See the
  224.                       syntax section for more discussion on memo lengths)
  225.  
  226.           Dup       - If duplicate checking is on and DBTCHECK finds that
  227.                       a block number has been used more than once than
  228.                       this message will print along with the record number
  229.                       containing the original block number.  Having
  230.                       duplicate block numbers simply means that two record
  231.                       lay claim to the same memo.  Can be fixed by copying
  232.                       dbf to a new name (from inside of dBASE) and then
  233.                       delete the duplicate memo data.
  234.  
  235.           Overlap   - A memo has been placed inside the space supposedly
  236.                       occupied by another memo.  Can be fixed by copying
  237.                       dbf to a new name (from inside of dBASE), this will
  238.                       then place the memo data in its own block.
  239.  
  240.           Free lost - The link-list of free blocks points to a block which
  241.                       does not exist.  Fix all "free" errors with the /T
  242.                       or /B parameter, DBTCHECK will set the next
  243.                       available block to the end of the file. 
  244.  
  245.           Free used - The link-list of free blocks is pointing to a block
  246.                       which is already being used for a memo.
  247.  
  248.           Free loop - The link-list of free blocks has a loop (ex:
  249.                       3->4->3).  
  250.  
  251.  
  252.                                 Other General Errors
  253.  
  254.           Error in closing file
  255.                   Had some trouble closing the file.
  256.  
  257.           Error in creating file
  258.  
  259.  
  260.  
  261.  
  262.                                DBTCHECK ERROR MESSAGES
  263.  
  264.  
  265.  
  266.  
  267.                              DBTCHECK DOC - August 1990
  268.  
  269.  
  270.  
  271.                   Had some trouble creating a fresh file, check for files
  272.                   with the same name that may be READ-ONLY.  
  273.  
  274.           Error in finding size of file
  275.                   Couldn't figure out how big a file was.
  276.  
  277.           Error in memory allocation of
  278.                   Ran out of memory to allocate memory for this object.
  279.  
  280.           Error in opening file
  281.                   Had some trouble opening the file, check for files that
  282.                   may be READ-ONLY.
  283.  
  284.           Error in parameter passed
  285.                   You specified an unknown or incorrect parameter.
  286.  
  287.           Error in reading from file
  288.                   Trouble reading from file, may be sign of file
  289.                   corruption.
  290.  
  291.           Error in seeking in file
  292.                   Trouble moving around in file, may be corruption or bad
  293.                   disk.
  294.  
  295.           Error in value of parameter passed
  296.                   The value passed may be too high or low.
  297.  
  298.           Error in writing to file
  299.                   Trouble writing to file, may be corruption or bad disk.
  300.                      
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                DBTCHECK ERROR MESSAGES
  329.  
  330.  
  331.