Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
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????
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement