Make sure your primary key is defined correctly in the view. The field or fields you specify in the PK must uniquely identify a record.
>User will typically change a particular field with different values for different rows.
>As I do a TABLEUPDATE, instead of saving those changes to the table, all the rows will get the same value for that field (it will save the last value changed for that field).
>Example:
>Field hrnotes row 1 changed to ‘A’
>Field hrnotes row 2 changed to ‘B’
>Field hrnotes row 3 changed to ‘C’
>Field hrnotes row 4 changed to ‘D’
>When I do table update:
>xSuccess=TABLEUPDATE(1,.T.,'cMyTable')
>row 1 changed to ‘D’
>row 2 changed to ‘D’
>row 3 changed to ‘D’
>row 4 changed to ‘D’
>HELP!
>Thank you all!
>
>Here’s my setup:
>
>
>xRefno=’0400001’
>lSuccess=SQLEXEC(THIS.lnHandle,"SELECT myTable.empid,hrnotes,accnotes,trefno,lastupdate,lastupdateby ;
>FROM myTable WHERE tRefno='&xRefNo'","cMyTable")
>
>
>IF lSuccess>0
>
> SET MULTILOCKS ON CURSORSETPROP('Buffering',5, ‘cMyTable ')
> CURSORSETPROP('TABLES','ERCAsFor',' cMyTable ')
> CURSORSETPROP('UPDATABLEFIELDLIST','empid,trefno,hrnotes,accnotes,lastUpdate,lastUpdateBy',' cMyTable '
> CURSORSETPROP('KeyFieldList',trefno',' cMyTable ')
> CURSORSETPROP('UpdateNameList','empid MyTable.empid, ercarefno MyTable.ercaRefNo, hrNotes MyTable.hrNotes, ;
> accNotes MyTable.accNotes, lastUpdate MyTable.lastUpdate, lastUpdateBy MyTable.lastUpdateBy',' cMyTable ')
> CURSORSETPROP('FetchMemo',.T.,' cMyTable ')
> CURSORSETPROP('SendUpdates',.T.,' cMyTable ')
>
>ELSE
> MESSAGEBOX('Error retrieving',16,'ERROR')
>ENDIF
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)