General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
TABLEUPDATE does not cursor's commit deleted records?
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????
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only