>...and I rebuilt my project.
>
>Here what happened...
>...Same stuff
>...it made no difference.
OK, now when the usual suspects are out of town, let's see who's in.
>My primary index, "PrimaryKey", is defined as:
>LEFT(ALLTRIM(filename),RAT("\",ALLTRIM(filename)))+RIGHT(ALLTRIM(filename),11)+SUBSTR(ALLTRIM(filename),RAT("\",ALLTRIM(filename))+1,1)
Now you can't actually be sure of the actual length of your key expression once it gets evaluated - and I guess VFP measures its length from the first record. The only thing which has variable length here is the month - if your first record wasn't in February (8 chars), but in May instead (3 chars), the length of your key is taken 5 bytes shorter than it needs. The quick'n'dirty solution for you would be to have
PADR(LEFT(ALLTRIM(filename),RAT("\",ALLTRIM(filename)))+RIGHT(ALLTRIM(filename),11)+SUBSTR(ALLTRIM(filename),RAT("\",ALLTRIM(filename))+1,1), 160)
as your key, though I was thinking there should be another way, like
stuff(filename, rat("\",filename)+1,1,"") - subs(filename, rat("\",filename)+1,1)
Note the use of the minus operator - it will move the R or C character before any trailing blanks, so the trailing blanks are "removed" by compactness of the index engine itself, and not by string manipulation in the key expression. This key has length of filename+1, is fixed length, and should work. Also should be slightly quicker, I hope.