Hi Inge
The commands SELECT-SQL, INSERT-SQL and DELETE-SQL do not read/modify the cursor "pending updates" buffer.
Try replacing
DELETE FROM cMyTable WHERE refno=12
with
DELETE IN cMyTable FOR refno=12
Hope this helps,
Jose
>I used SQLEXEC to give me a cursor, & used CURSORSETPROP to make the cursor updatable.
>But when I delete some records from the cursor, the records was not marked deleted in the original table/data source, although it is marked deleted in the cursor. How do I make the records deleted in the original table/data source? (I used 'DELETE FROM' command + TABLEUPDATE command).
>
>lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>"SourceDB=c:\projects\myData.dbc;SourceType=DBC;UID=;PWD=;"
>
>THIS.lnHandle=SQLSTRINGCONNECT(lcConnStr)
>
>IF THIS.lnHandle>0
>lSuccessMyTable=SQLEXEC(THIS.lnHandle,"SELECT * FROM myTable","cMyTable")
>IF lSuccessMyTable=1
> SET MULTILOCKS ON
> CURSORSETPROP('Buffering',5,'cMyTable')
> CURSORSETPROP('TABLES','myTable','cMyTable')
> CURSORSETPROP('UPDATABLEFIELDLIST','refno,budgetcode','cMyTable')
> CURSORSETPROP('KeyFieldList','refno','cMyTable')
> CURSORSETPROP('UpdateNameList','refno myTable.ercaRefNo,budgetcode myTable.budgetcode','cMyTable')
> CURSORSETPROP('FetchMemo',.T.,'cMyTable')
> CURSORSETPROP('SendUpdates',.T.,'cMyTable')
>ENDIF
>ENDIF
>
>DELETE FROM cMyTable WHERE refno=12
>BROWSE
>*all records with refno=12 was marked for deletion.
>
>TABLEUPDATE(0,.T.)
>*records not marked for deletion in original table????