Hi!
We met the same situation also with REPLACE ALL command. It stops to do what supposed at the some moment, or just throws weird errors. We did had no any workaround for it but just use DO WHILE !EOF()... loop and do a partial scans using 'SCAN NEXT 1000' command with a FLUSH command after each scan.
Looks like something happened with memory, optimization, indexes buffers etc. Nobody knows completely what is inside of that black box called VFP ;)
HTH.
>My officemate needed to add a primary key to an @10,000 record database.
>He added PKEY a DateTime field.
>He figured, since users add records by an Add button, then fill in the rest; Replacing PKEY with DATETIME() on add is fine. I wonder if that is enough.
>
>Anyway, after he added the field PKEY, he wrote a small prg to update the @10,000 records:
>
>USE Mtg EXCLUSIVE
>ldCount = {^2001-01-01 12:00:00AM}
>SCAN
> REPLACE PKey WITH ldCount
> ldCount = ldCount+1
>ENDSCAN
>
>
>When he tried to add a primary index on PKey, he got the uniqueness violated error.
>He is running VFP 6.0 SP5 and Win 2000 SP1.
>(This is from memory.)
>I queried the database, and found 26 PKey dups. Starting around record 92000, and about every 7th or 8th record thereafter; there was a dup, then a skip.
>
>I mean: RecNo PKey
> 92008 {^2001-01-08 09:20:08AM}
> 92009 {^2001-01-08 09:20:08AM}
> 92010 {^2001-01-08 09:20:10AM}
>
>I fixed this by changing his prg to: REPLACE ALL PKey WITH ldCount+RECNO()
>But, I am wondering if anyone has encountered, or can explain this dupping.
>It is like the REPLACE and the var update got confused.
>
>Thanks in advance,
>Carol Dewar
>Magram Computer Services
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.