home *** CD-ROM | disk | FTP | other *** search
-
-
- DBTCHECK DOC - August 1990
-
-
-
- DBTCHECK
- August 1990
- Erik A McBeth
-
- INTRODUCTION
-
-
- DBTCHECK is designed to help in the fixing and diagnosing of
- dBASE memo problems in both dBASE III, III+ and IV. Many common
- memo problems can be fixed by DBTCHECK and its strength lies in
- its simplicity and speed. DBTCHECK is NOT intended to fix severe
- data corruption in memos, but fortunately most memo problems are
- related to factors outside of the data itself. Neither
- Ashton-Tate nor its author assumes ANY responsibility for damages
- incurred as a result of using DBTCHECK. There is no guarantee
- that your data will be set right, always RUN THE PROGRAM ON
- BACKUP DATA.
-
- DBTCHECK will help with the following problems:
-
- 1) Memo marker staying uppercase after deleting all the data.
- 2) "Disk full" errors when saving/accessing memos.
- 3) Memo (DBT) files growing to extreme size during dBASE copy
- operations.
-
- In general, after running DBTCHECK and fixing any errors,
- you'll want to load dBASE and do the following:
-
- USE file
- COPY TO temp
- ZAP (erases all records, do you have a backup file?)
- APPEND FROM temp
-
- This should help to shrink the DBT file and also reset any memo
- markers in the DBF file.
-
- This copy operation could also be accomplished by using a
- utility (developed by the author) called DBTCNVT which "packs"
- memo fields and will even allow you to optimize memo operations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DBTCHECK INTRO
-
-
-
-
- DBTCHECK DOC - August 1990
-
-
-
- DBTCHECK SYNTAX
-
-
- DBTCHECK dbf_file [/F /T /B /I /S /L /X /O /3 /4 /Rx /Jx]
- where:
-
- dbf_file = the dBASE file you want checked
-
- /F = Fix the errors in the dbF only. These errors
- include deleted or lost blocks and version byte.
-
- /T = Fix the errors in the dbT only. These errors
- include "too big" memos and wrong blocksize. When
- guessing the size of "too big" memos a guess of
- blocksize-8 or 512-8=504 should be OK.
-
- /B = Performs both the /F and /T parameters.
-
- /I = Show Information on all records with memos.
- DBTCHECK usually only shows information on a record
- when errors are found.
-
- /S = Speed mode, in this mode only lost memo blocks can
- be checked and cleaned up.
-
- /Lx = Set block number Limit or threshold. If you
- suspect that a block number is out of range and
- DBTCHECK is not marking it as such then you can use
- this parameter. /L1234 would set the threshold at
- 1234, all memos with pointers greater than or equal
- to this will be considered "lost."
-
- /X = Perform eXtensive testing, test for duplicate and
- overlapping blocks. In order to accomplish this
- two files (_BLOCKS.DBF and _BLOCKS.NDX) must be
- created in the current drive. Info on each memo
- takes up about 40 bytes. This operation can be
- slow, but is much faster than earlier versions of
- DBTCHECK.
-
- /O = Show information on all records with memos but in
- block number, as opposed to record number, order.
- See /X above for info regarding diskspace.
-
- /3 = Force the opening of the file as a dBASE III type
- memo file. If we also specify the parameter /F (or
- /B) then the version byte in the dbf file will also
- be set.
-
- /4 = Force the opening of the file as a dBASE IV type
- memo file. If we also specify the parameter /F (or
- /B) then the version byte in the dbf file will also
- be set.
-
-
-
-
- DBTCHECK SYNTAX
-
-
-
-
- DBTCHECK DOC - August 1990
-
-
-
- /Rx = Read the memo file using a block size of x bytes.
- Use this if you suspect that the blocksize in the
- memo header has become corrupted. If you also
- specify the parameter /T (or /B) then this
- blocksize will be written to the memo header.
-
- /Jx = Jump to record x to start the analysis/fixup. This
- is handy if you suspect that the corrupt memos
- start toward the end of the file.
-
-
- all parameters besides the file name are optional, DBTCHECK will
- NOT fix a file unless you tell it to.
-
- EX:
-
- DBTCHECK tester
-
- we want DBTCHECK to check for errors in the dBASE data file
- TESTER.DBF. DBTCHECK will only report problems, not fix them.
-
- DBTCHECK tester /B
-
- This will cleanup errors found in both the data and memo file.
-
- Hint: the headers of the DBF and DBT files are corrected first,
- before any other file operations (except looking for free blocks)
- and if that is all you need fixed then you might try something
- like this:
-
- DBTCHECK tester /B /4 /R512 /J100
-
- This would set the DBF version byte to look for dBASE IV memos,
- the block size in the DBT to be 512 bytes, and the next available
- block number in the DBT to be end-of-file. We use the /J
- parameter to jump to a record number far down field so we don't
- have to wade through all the memos. This is of course only an
- example and your specific needs in changing the file headers
- would probably be different.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DBTCHECK SYNTAX
-
-
-
-
- DBTCHECK DOC - August 1990
-
-
-
- DBTCHECK ERROR MESSAGES
-
- Explanation of errors which occur with memos.
-
- Deleted - Memo block deleted, DBF marker points to a memo
- which has been deleted or has a length of zero. Fix
- with /F or /B parameter.
-
- Lost - Memo block doesn't exist, DBF marker points beyond
- the end of the file. Fix with /F or /B parameter.
-
- Too big - Memo is too big, the memo either has a length
- greater than the size of the file or the end of file
- marker was never found in this memo. You must run
- DBTCHECK with the /T or /B parameter in order to
- cleanup this sort of error. You will be asked to
- provide the memo lengths of these huge memos.
- Guessing a number too high could destroy information
- in subsequent memos - USE WITH CAUTION! (See the
- syntax section for more discussion on memo lengths)
-
- Dup - If duplicate checking is on and DBTCHECK finds that
- a block number has been used more than once than
- this message will print along with the record number
- containing the original block number. Having
- duplicate block numbers simply means that two record
- lay claim to the same memo. Can be fixed by copying
- dbf to a new name (from inside of dBASE) and then
- delete the duplicate memo data.
-
- Overlap - A memo has been placed inside the space supposedly
- occupied by another memo. Can be fixed by copying
- dbf to a new name (from inside of dBASE), this will
- then place the memo data in its own block.
-
- Free lost - The link-list of free blocks points to a block which
- does not exist. Fix all "free" errors with the /T
- or /B parameter, DBTCHECK will set the next
- available block to the end of the file.
-
- Free used - The link-list of free blocks is pointing to a block
- which is already being used for a memo.
-
- Free loop - The link-list of free blocks has a loop (ex:
- 3->4->3).
-
-
- Other General Errors
-
- Error in closing file
- Had some trouble closing the file.
-
- Error in creating file
-
-
-
-
- DBTCHECK ERROR MESSAGES
-
-
-
-
- DBTCHECK DOC - August 1990
-
-
-
- Had some trouble creating a fresh file, check for files
- with the same name that may be READ-ONLY.
-
- Error in finding size of file
- Couldn't figure out how big a file was.
-
- Error in memory allocation of
- Ran out of memory to allocate memory for this object.
-
- Error in opening file
- Had some trouble opening the file, check for files that
- may be READ-ONLY.
-
- Error in parameter passed
- You specified an unknown or incorrect parameter.
-
- Error in reading from file
- Trouble reading from file, may be sign of file
- corruption.
-
- Error in seeking in file
- Trouble moving around in file, may be corruption or bad
- disk.
-
- Error in value of parameter passed
- The value passed may be too high or low.
-
- Error in writing to file
- Trouble writing to file, may be corruption or bad disk.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DBTCHECK ERROR MESSAGES
-
-
-