Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Unsuccesful TABLEUPDATE for DELETE FROM command w. SPT
I'm trying to mark some VFP records as deleted. I'm using SPT, but not quite sure how to set up CURSORSETPROP: what fields do I list in UPDATABLEFIELDLIST & UpdateNameList? Do I need to list all fields in myTable? I've tried (as below), but TABLEUPDATE was unsuccesfull. Please help. Thanks all!
SET EXCLUSIVE OFF
*gDataPath = path of where the table is
gDataPath='c:tempdata\'
lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
"SourceDB=&gDataPath;SourceType=DBF;UID=;PWD=;"
lnHandle=SQLSTRINGCONNECT(lcConnStr)
lSuccess=SQLEXEC(lnHandle,;
"SELECT * FROM myTable","cTable")
SET MULTILOCKS ON
CURSORSETPROP('Buffering',5,'cTable')
CURSORSETPROP('TABLES','myTable','cTable')
CURSORSETPROP('UPDATABLEFIELDLIST','uid','cTable')
CURSORSETPROP('KeyFieldList','uid','cTable')
CURSORSETPROP('UpdateNameList','uid myTable.uid','cTable')
CURSORSETPROP('FetchMemo',.T.,'cTable')
CURSORSETPROP('SendUpdates',.T.,'cTable')
DELETE FROM cTable WHERE uid=92156126
IF TABLEUPDATE(1,.T.,'cTable')
MESSAGEBOX('OK')
ELSE
MESSAGEBOX('DID NOT UPDATE')
ENDIF
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