Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Am I misusing TableUpdate()?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00261437
Message ID:
00264812
Vues:
50
The code now:
		public nMyBugs
		public arMyErr
		dimension arMyErr[1]
		nMyBugz = AError(arMyErr)
		lCSPResult = CursorSetProp('buffering',1,'Customers')
		select CustUpdate
		wait window 'ok point 1'
		select CustUpdate
		lnFieldCount = AFIELDS(laFields,'CustUpdate')
		FOR nNothing = 1 TO lnFieldCount
			wait window 'ok point 2'
			DO CASE
				CASE GETFLDSTATE(nNothing,'CustUpdate') = 3
					wait window 'ok point 3'
					SETFLDSTATE(nNothing,1,'CustUpdate') 
					wait window 'ok point 4'
				CASE GETFLDSTATE(nNothing,'CustUpdate') = 4
					wait window 'ok point 5'
					SETFLDSTATE(nNothing,2,'CustUpdate') 
			endcase
		ENDFOR
		tableupdate(1,.t.,alias())
	else
	endif
In the debugger, this is what I have in the Watch Window:


Name / Value / Type

getfldstate(nNothing,'custupdate') / 4 (in red) / N
nNothing / 1 / N
lCSPResult / .t. (in red) / L


Then I click my commit button and get the error 'invalid argument etc' and the Trace window arrow is pointing to setfldstate(nNothing,2,'custupdate').

The Locals window for my cmdbutton shows:
arMyArr:
[1,1] = 11
[1,2] = "Function argument value, type or count is invalid"
[1,3] to [1,7] is .NULL.

nMyBugs = .f.
nnothing = 1
nresult = 6
lnfieldcount = 21



At this point, my code never makes it to TableUpdate(), a few generations ago it was returning .f. and I could not see any changes in the base table.



>Steve,
>
>You are not checking the return values from the cursorsetprop() or the Tableupdate() and either of them could be returning .F. indicating that they did not do what you asked. You still haven't told us if TableUpdate is returning .T. indicating that it did, in fact, do the update.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform