I have a cursor in Visual Foxpro 6 created as follows.
select month, memid, mname, bt, st, bh, sh, totk, toth, sum(totk*0.025)/100 as laga, sum(toth*0) as hchg, sum(totk*0.050)/100 as Tax ;
from abc2 ;
group by memid ;
order by 2 ;
into curs abc3
IF !USED("abc3")
USE abc3 in 0
ENDIF
select abc3
go top
do while not eof()
update abc3 set month = Thisform.txtReportHeader.Value
skip
ENDDO
The line 'update abc3 set month = Thisform.txtReportHeader.Value' gives me an error, saying I cannot update the cursor. How can I update this column with the value of the text field 'Thisform.txtReportHeader.Value'?
To make a cursor updateable you need to use the READWRITE clause. ie:
However, if I remember right, READWRITE was introduced in VFP7. If it is right, then you should use the old trick to make it updatable:
So your code become:
PS: Although this kind of SQL works and doesn't give an error in VFP7 and earlier, try writing valid SQL without any ambiguity. That is, include all your non-aggregate columns in the group by. If you can't, then think twice that there might be something wrong with your query.