I's most likely that problem lies in the getinarow() function code or it effect on UPDATE command. Try first to seprate the getinarow() function execution from UPDATE command.
FOR lnNum = 1 TO 50
lnRepeats = getinarow(lnNum)
UPDATE repeats SET repeated = lnRepeats where number = lnNum
ENDFOR
Notice that FOR loop is equivalent of yours DO WHILE construction.
>I have a series of sql updates, that worked yesterday. Today, I get a series of assorted errors. I slowly but surley get rid of some to only aqquire new ones.
>In the snippet below, I get "Record not locked"
>do while num <50
> UPDATE repeats SET repeated= getinarow(num) where number = num
> num = num + 1
>enddo
>Thats a new one on me. I've tried RLOCK() on the entire table, no luck.(Alias not found, well, duh, I'm not opening it, I'm running SQL UPDATE)
>In the called function (getinarow), which steps through another table, I get "File is in use", even in the first iteration. If I try
>USE Yada AGAIN ALIAS LYada
>and close the alias before returning, on return I get
>"Fatal excpetion code C0000005 at ......(prg file, line number = the update line above)
>
>It all worked fine yesterday!
--sb--