Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TableUpdate question, I think...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00672014
Message ID:
00672132
Vues:
6
>Could you post your code where you save your data.it will help to understand better.
------------------------
When the user clicks a report button or closes the form my SaveAll method fires... In the SaveAll are the following segments:
	PRIVATE laError, problemrecs
	DIMENSION laError[1,1]
	DIMENSION problemrecs[1,1]
	
	*RML 06/24/2002
	IF RECCOUNT("vpOrderItems_order_ID") > 0
		SELECT vpOrderItems_order_ID
		SCAN
			SCATTER MEMO MEMVAR
			SELECT vwbobsout_orderitems
			*LOCATE FOR ALLTRIM(vwbobsout_orderitems.Report_num) == ALLTRIM(m.Report_num)
			LOCATE FOR vwbobsout_orderitems.Report_num == m.Report_num
			IF NOT FOUND()
				APPEND BLANK
			ENDIF
			GATHER MEMO MEMVAR
		ENDSCAN
	ENDIF
	
.... and further down....
	******************************************************
	*RML 06/24/2002 - populate WBOBSOUT
	******************************************************
	*RML 06/24/2002
	IF RECCOUNT("vwbobsout_orderitems") > 0
		SELECT vwbobsout_orderitems
		BEGIN TRANSACTION
			lSuccess = .T.
			lTableUpdateRetVal =  .T.
			*optimistic table buffering is on for vwbobsout_orderitems
			lTableUpdateRetVal =  TableUpdate(2,.T., "vwbobsout_orderitems", "problemrecs")
			IF NOT lTableUpdateRetVal
				AERROR(aErrorArray)
				IF TYPE("aErrorArray[1]")="N" AND TYPE("aErrorArray[2]")="C"
				    lcMsg = STR(aErrorArray[1])+"  "+aErrorArray[2]
				    MESSAGEBOX(lcMsg)
			    ENDIF
			    lcMsg = ''
			    IF TYPE("problemrecs")<>"U"
			    	FOR x=1 TO ALEN(problemrecs)
					    IF TYPE("problemrecs[x]")="N"
						    lcMsg = lcMsg + STR(problemrecs[x]) + CHR(13)
					    ENDIF
				    ENDFOR
			    ENDIF
				MESSAGEBOX( "The WBOBSOUT table was not updated for" +CHR(13)+ ;
					"record "+str(n) +CHR(13)+ ;
					"Report_Nam "+vwbobsout_orderitems.Report_Nam +CHR(13)+ ;
					"Report_Num "+vwbobsout_orderitems.Report_Num+CHR(13)+ ;
					"" + lcMsg, ;
					MB_ICONEXCLAMATION+MB_OK, ;
					"Omnia Background Search - Saving Order Information")
				lSuccess = .F.
				lRetVal  = .F.
				*TableRevert(.T.)
			ELSE
				* update worked!
			ENDIF
		END TRANSACTION
	ENDIF
	******************************************************
	*RML 06/24/2002 - populate WBOBSOUT
	******************************************************
The messages occurr when the following line (near the top of the 2nd segment)runs:
lTableUpdateRetVal=TableUpdate(2,.T., "vwbobsout_orderitems", "problemrecs")
HTH,
Rick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform