PROCEDURE MakeUpdatable LPARAMETERS tcCursor, tcTable IF VARTYPE(tcCursor) <> 'C' RETURN .f. ENDIF IF VARTYPE(tcTable) <> 'C' RETURN .f. ENDIF IF NOT USED(tcCursor) RETURN .f. ENDIF CURSORSETPROP('Tables', tcTable) ** The next property must include every remote field matched with the ** view cursor field. LOCAL lcFields, lcUpdate, llRetVal lcFields = '' lcUpdate = '' FOR lnI = 1 TO FCOUNT(tcCursor) IF NOT EMPTY(lcFields) lcFields = lcFields + ', ' ENDIF lcFields = lcFields + FIELD(lnI, tcCursor) ; + ' ' + tcTable + '.' + FIELD(lnI, tcCursor) IF UPPER(FIELD(lnI, tcCursor)) == 'KEYID' LOOP ENDIF IF NOT EMPTY(lcUpdate) lcUpdate = lcUpdate + ', ' ENDIF lcUpdate = lcUpdate + FIELD(lnI, tcCursor) ENDFOR llRetVal = CURSORSETPROP('UpdateNameList', lcFields, tcCursor) llRetVal = CURSORSETPROP('KeyFieldList', 'KeyID', tcCursor) ** The next property specifies which fields can be updated. llRetVal = CURSORSETPROP('UpdatableFieldList', lcUpdate, tcCursor) ** The next property enables you to send updates. llRetVal = CURSORSETPROP('SendUpdates', .T., tcCursor) llRetVal = CURSORSETPROP('UpdateType', 1, tcCursor) llRetVal = CURSORSETPROP('WhereType', 3, tcCursor) RETURN llRetVal ENDPROC>
>* Tables, KeyFieldList, UpdateNameList, UpdatableFieldList, and SendUpdates >cursorsetprop("Buffering",5) >cursorsetprop("Tables","test") >cursorsetprop("KeyFieldList","item_id","test") >cursorsetprop("UpdateNameList","itemdesc","test") >cursorsetprop("UpdatableFieldList","itemdesc",'test') >cursorsetprop("SendUpdates",.t.) >