General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
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
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