>I have an application written in VFP5 that I have 400 different agents using at their sites. I would like to create a utility to reindex the files better than I am currently giving them. Basically if the CDX file gets corrupt I would like to delete the CDX file and create a new one entirely. My original program I am using was pulled apart from a gendbc output. The problem is, I cannot recreate the entire tables because they have data that they need to keep.
>This may be plain enough for you experts but I unfortunately am not. Any help on creating a new cdx file on an existing table would be appreciated.
In FoxPro, you could DELETE TAG, followed by INDEX ...
In Visual FoxPro, this gives you problems: the indices are used for RI; you can't just delete an index.
Perhaps REINDEX would work. I remember, though, that in FoxPro 2.x it was preferable to delete the index an recreate it. Apparently REINDEX didn't always work correctly.
>I also keep a newfile for the next key generator so I suppose I should check for accuracy on that in this program as well. Correct?
That makes sense.
select max(clientid) as lastnumused from client into cursor tmp
update serialnumbers set nextnum = tmp.lastnumused + 1 where sequencename = "client"
Regards, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)