INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Clipper 5.03 multiple index entries

Clipper 5.03 multiple index entries

(OP)
Has anyone ever run across a situation in which an index develops multiple identical entries as records are added?  I have a loop that steps through a table and then either creates a new record in another table if the key fields don't exist, or updates a date-related sequence of fields (month01, month02, etc.) if the record already exists.  When I looked at this in DBU, the resulting table looks fine, yet activating the index that was active when it was built shows multiple identical records (with the same recno() value).  The index is deleted prior to the start of the loop, so I can't think of a reason why this might occur.  Any ideas?  Thanks!

J. Carls

RE: Clipper 5.03 multiple index entries

It depends largely on the RDD used, and also the size and number of records in the dbf. Please report.

Are you using Clipper 5.03, or 5.3?, 'cause I don't recognize the 5.03 version... so I assume it's 5.3. if so, be sure to install all updates and fixes available from CA.

HTH
TonHu

RE: Clipper 5.03 multiple index entries

(OP)
Sorry, I completely messed up the version reference:  It's 5.2e.  I'm using it via a pcAnywhere window into the legacy PC on which the software was developed, so it seems unlikely that it's a change in the environment.  I seem to have "cured" it by changing my ending code from

SELECT 'alias'
USE

to

CLOSE 'alias'

and then added a COMMIT after that.  Supposedly (because I added the code to do it) both the dbf and the ntx were being deleted each time prior to running the function, but what I got was an index with an additional set of pointers each time I ran it instead (so that, when I selected the index, I would see two then three then four then five instances of the same record number).  Very strange.

JC

RE: Clipper 5.03 multiple index entries

Ah, so you're using the DBFNTX RDD, and that is known to be rather buggy sad I've written about that on several occasions in this forum.
Committing, Closing and reopening the files would be a cure, but if it has to happen often will become a perfomance issue.

Switching to DBFCDX (or xHarbour altogether...) would solve most of the issues, and also helps if performance is already an issue.

HTH
TonHu

RE: Clipper 5.03 multiple index entries

JC,

Were the dups only showing with the index open, and not actually in the DBF.  If so it is the index, erase the old index and execute an INDEX ON to setup the index again.  If you were doing the INDEX ON without erasing the existing index that can cause the problem you saw.  The old index was corrupt and that was causing the problem to reoccur.  Strange to see this with the old index being erased.  Sounds like a windows thing,  how many records were added before the problem was apparent.  Has the version of Windows been upgraded lately?

Jim C.

RE: Clipper 5.03 multiple index entries

(OP)
>The old index was corrupt and that was causing the problem to reoccur.  Strange to see this with the old index being erased.  <

Yes, indeed.  From your comments, it looks as if the old index was not being erased properly.

I looked through other parts of my old code and noticed that I was using ferase() with arrays of file names, whereas here I just had two files and used ERASE instead (because that's what I use in VFP and had forgotten the Clipper options).  In any case, it seems to be working now.

As far as Windows versions go, the development env is on a Windows 95 system, with the exe moved to another 95 acting as a server disk and run from a 98 workstation (these are all from the original development era).  When I'm done, it will replace the current version (from the same dev env) that is running on XP systems.  I'm a little uncertain that the Windows version is the direct problem, though.  It's more likely that my fading memory of how I did things in the first place is leading me into untried approaches.  

My biggest problem in going back to this is that I'm adapting some murky statistics code written by someone who was not enthusiastic about using meaningful variable names and I can't get the debugger to run.  I am not sure, other than the prerequisite of using /B, how to get it to work anymore.

JC

RE: Clipper 5.03 multiple index entries

jcarls,

I seen weird things happen when the underlying OS gets updated.  Usually forcing an extra COMMIT or two to clear it up.  But the ghost images of a record is almost always a corrupt index.  I always test for the old index with an IF FILE() and then ERASE "FILENAME" if found.  

Jim C.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close