Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unsuccesful TABLEUPDATE for DELETE FROM command w. SPT
Message
From
02/04/2003 18:16:38
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Unsuccesful TABLEUPDATE for DELETE FROM command w. SPT
Miscellaneous
Thread ID:
00773330
Message ID:
00773330
Views:
50
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
Map
View

Click here to load this message in the networking platform