Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unsuccesful TABLEUPDATE for DELETE FROM command w. SPT
Message
 
 
À
02/04/2003 18:16:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00773330
Message ID:
00774506
Vues:
14
Hi Inge,

See if mskb #Q138094 How to Create Updatable Views by Using SQL Passthrough> or faq #8153 How to make SQL Pass-Through cursor updatablecould help you.


>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
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform