Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique Value Table Not Updating
Message
De
07/07/2000 13:14:53
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Unique Value Table Not Updating
Divers
Thread ID:
00389578
Message ID:
00389578
Vues:
57
I am having a problem getting a serial-number table updated.

I have a form MYFORM.scx. In it, I want to fetch the next
available key value from a table and increment it.



MYFORM.scx has the following DataEnvironment:
ULOGKEYS
USERLIST
SOITEM
USERLIST1 (a 2nd copy of USERLIST for dupe checking)


ULOGKEYS is a one-field, one-record table. The record holds
the next available key. When MYFORM.FetchNextKey() is called,
it should lock the record, return the value, increment the
field, and unlock the record.



in MYFORM.Load I have:
set multilocks ON

=CursorSetProp('Buffering',2,'USERLIST')
=CursorSetProp('Buffering',2,'SOITEM')
=CursorSetProp('Buffering',5,'ULOGKEYS')



in MYFORM.FetchNextKey() I have:
cRetVal = ULOGKEYS.CurrKey
nCurrKey = val(ULOGKEYS.CurrKey)
nNextKey = nCurrKey + 1
cNextKey = allt(str(nNextKey))
replace ULOGKEYS.CurrKey with cNextKey
x = TableUpdate(.t.,.t.,'ULOGKEYS')
UNLOCK IN ULOGKEYS



after the TableUpdate:
cRetval = "2" && Correct
nCurrKey = 2.00 && Correct
nNextKey = 3.00 && Correct
cNextKey = "3" && Correct
x = .T. && Correct

BUT:
ULOGKEYS.CurrKey = "2" && I want it to be "3"

What am I missing?

Thomas G. Hirschman
"I got vision and the rest of the world wears bi-focals."
- Paul Newman in
"Butch Cassidy and
the Sundance Kid"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform