Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!netnews.upenn.edu!vax1!vlsi3b15!lehi3b15!vu-vlsi!dsinc!wells!mdi386!bruce From: bruce@mdi386.UUCP (Bruce A. McIntyre) Newsgroups: comp.databases Subject: Re: Problem with Clipper a'86 Summary: Finds dont ALWAYS work Message-ID: <47@mdi386.UUCP> Date: 29 Apr 89 16:49:01 GMT References: <10660@ibmpcug.UUCP> Organization: Wells Computer Systems Corp., Levittown, Pa. 19058 Lines: 45 In article <10660@ibmpcug.UUCP>, alanj@ibmpcug.UUCP (Alan Jay) writes: > In article <1081@haydn.kulesat.uucp> lily@haydn.kulesat.uucp writes: > >Now, sometimes when SEEK-ing a > >record (with the right index file opened) Clipper can't find it. > >Found() becomes .F. although I'm perfectly sure that the record is > >in the database. > Check that the item you are seeking can be found TRIM the variable > is EXACT ON etc. This can be quite important even with simple keys. Even > if you think its right test it with dBASE III, Fox or DBXL they should give > give the same results (if you can get access to a copy). (This is one of > the gripes with using Clipper bad development environment). If the construct > works then the index may be corrupt. > >I tried solving the problem by REINDEX-ing, but > >it didn't work. > I now always use INDEX to recreate index files. I have recently had it > suggested that one should even go so far as to delete the index file > before INDEX ON (ah well it makes life interesting). > > Alan Jay @ The IBM PC User Group, PO Box 360, Harrow HA1 4LQ ENGLAND > Phone:+44 -1- 863 1191 Email: alanj@ibmpcug.CO.UK > Path: ...!ukc!slxsys!ibmpcug!alanj Fax: +44 -1- 863 6095 I know that this may seem strange, but if your index has a high number of duplicates, then you may find it may miss one. The algorithyms are good, but not perfect. It sounds to me more like the TRIM problem, but it wouldn't match on LOCATE then either. Clipper .NTX files are sensitive (but no more so than dBASE), and a periodic INDEX ON is called for. Also make sure that the database was created with the correct version of CLIPPER. There are some problems with record pointer references when mixing files between diff- erent versions of dBASE and/or CLIPPER. If you PACK the file with dBASE, Clipper says the records are still there..., etc. The best answer sometimes is to copy "COPY TO xxx" and then "INDEX ON" from the new file. If you are running in clipper, you may want to check the NETERR() function to make sure that the file was readable and the find didn't fail because of an error reading the .NTX file( this even if you are running single user!!!). Clipper will do a certain number of search file operations on a bad file, returning only the "false" without generating a runtime error... bruce -- ========================================================================= Bruce A. McIntyre, McIntyre Designs, Inc. VOICE(215)322-1895 143 Bridgetown Pike, Langhorne, Pa. 19047 DATA (215)357-2915 {wells|lgnp1|prapc2}!mdi386!bruce bruce@wells tbit+ Unix, Xenix, Netware and PC-DOS Applications development. Specializing in Database Applications since 1980.