Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Make a cursor updatable
I'm running a select that I need to be updatable. This is the code:
SELECT inventory.stocknum AS stocknum;
FROM Tomparco!inventory AS inv_this_trans;
INTO CURSOR inv_this_trans;
WHERE inv_this_trans.trans_id = trans_num; &&trans_num is a variable
ORDER BY inv_this_trans.stocknum
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if I run the following, I get the error "cannot update the cursor"
DBSETPROP('inv_this_trans','view','tables','Tomparco!inventory')
DBSETPROP('inv_this_trans','view','SendUpdates','Tomparco!inventory')
DBSETPROP('inv_this_trans.stocknum','field','keyfield',.T.)
DBSETPROP('inv_this_trans.stocknum','field','updatename','inventory.memotxt')
DBSETPROP('inv_this_trans.stocknum','field','updatable',.T.)
if I run the following instead, I get the error "Property invalid for table cursors" on sendupdates
CURSORSETPROP('sendupdates',.T.,'inv_this_trans')
CURSORSETPROP('keyfieldlist','stocknum','inv_this_trans')
CURSORSETPROP('tables','Tomparco!inventory','inv_this_trans')
CURSORSETPROP('updatenamelist','memotxt','inv_this_trans')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
APPEND BLANK IN inv_this_trans
Because of the errors, I'm wondering if I should be using DBSETPROP() or CURSORSETPROP(), and just what I need to do to make this select updatable? All advice is welcomed.
Thanks
JD
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