Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique Value Table Not Updating
Message
De
07/07/2000 13:47:44
 
 
À
07/07/2000 13:46:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00389578
Message ID:
00389596
Vues:
17
>>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
>>
>
>Without taking a long look at your code and an in ULOGKEYS on the replace line. If your at EOF in your current area it will not replace successfully.

I'm sorry that wasn't clear. The line should be.
replace ULOGKEYS.CurrKey with cNextKey in ULOGKEYS
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform