>Hello everyone! I have some very serious problem that one of you may have already encountered and can offer me some advice. All other times that we had a data corruption I was able to fix the problem in just a matter of hours. With this one, however, I need serious help.
>
>My indexes are messed up and causing my program to fail so therefore I need to recreate them. The database is valid but if I refresh or recretae the indexes, I can't do the primary key-VFP 6 says that there is a duplicate value in the field that I am using as a primary key.
>
>I am aware that there are corruptions in these data files but I can't see them. I know that the last appended record that I see was not the last one that was appended into the file. I can't see the rest of my records. I issued a "select distinct" to see how many distinct values I had and it appeared that I had as many distinct values as the reccount() of the file, therefore there were no apparent duplicates. I tried to search for an odd value in that field but VFP did not find anything. I also scrolled through the file to check for any weird stuff but I did not find anything. Why can't I see the rest of my records that are possibly corrupted? How can I see them?
>
>I packed the data file just to make sure but to no avail.
>
>Will anyone please throw me some idea?
>
>TIA,
>Evelyn
Hiya Evelyn -
you have the code to recreate your RI stuff and PK values, right ?
IF you don't have many Child Records in other tables relying on FK values -
you can drop /delete the RI,
replace the column/field with 0
run your code for RI again in a code snippet to recreate the PK's ..
remember to back up first ..
also -
select PK, Count(*) from tablename group by PK
won't 'use' your RI rules at all - and you should be able to see WHICH records have repeating PK's.
hth - mondo regards [Bill]