Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert not inserting no more
Message
From
23/08/2014 08:57:01
 
 
To
22/08/2014 09:46:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01606233
Message ID:
01606298
Views:
73
>>You do need to provide some code Denis.
>
>Here is some code.
>
>
>CREATE CURSOR cÉtap1 (Séquence n(3), DescServ C(50), CléPrimaire I)
>
>* Here some code I didn't include. It will put records in the cursor cÉtap1
>
>CREATE CURSOR ;
>	cRapp ( Entete1 c(50),  Entete2  c(50),  Entete3  c(50), Entete4  c(50),;
>        
>        * And a bunch of other fields.
>)
>
>SELECT Séquence, DescServ, CléPrimaire ;
>FROM cÉtap1 ;
>ORDER BY DescServ ;
>INTO CURSOR cSuiviServ READWRITE 
>
>SELECT ... INTO CURSOR cEmp1Temp READWRITE 
>
>IF _tally = 0
>	DO FORM ts_messagebox WITH I('Pas de données à imprimer.')
>ELSE
>	nTotLigne = 0
>	SCAN  	
>		nTotLigne = nTotLigne + 1
>
>		INSERT INTO cRapp ( NomServ1) VALUES ("")
>		
>		SELECT cSuiviServ
>		nI = 0
>		SCAN
>			ni = nI + 1
>			cNi = ALLTRIM( STR( ni))
>			cReplace = "Replace NomServ" + cNi + " with cSuiviServ.DescServ in 'cRapp'"
>			&cReplace 	
>		ENDSCAN 
>
>		replace Entete1 WITH cEntete1 IN "cRapp"
>		replace Entete2 WITH cEntete2 IN "cRapp"
>		replace Entete3 WITH cEntete3 IN "cRapp"
>		replace Entete4 WITH cEntete4 IN "cRapp"
>		
>		replace date WITH cEmp1Temp.DateRv IN "cRapp"
>		Replace NomProf WITH I("Professeur") + ": " + ALLTRIM( cEmp1Temp.NomProf) IN "cRapp"
>		replace Heur WITH cEmp1Temp.HeurDebu IN "cRapp"
>		replace NomClient WITH cEmp1Temp.NomClient IN "cRapp"
>		replace Tél WITH cEmp1Temp.Téléphone IN "cRapp"
>
>		nPos = cEmp1Temp.Séquence
>		cReplace = "replace LignServChoisiPos" + ALLTRIM( STR( nPos)) +;
>			" with 'X' in 'cRapp'"	
>		&cReplace		
>			
>		SELECT cEmp1Temp
>	ENDSCAN 
>	
>	FOR nI = nTotLigne TO 25
>
>***
>*** This is the insert that doesn't insert
>***
>		INSERT INTO cRapp ;
>			(;
>			Entete1,;
>			Entete2,;
>			Entete3,;
>			Entete4;
>			);
>			VALUES ;
>			(;
>			cEntete1,;
>			cEntete2,;
>			cEntete3,;
>			cEntete4;
>			)
>	ENDFOR 
>
>        * Here again I didn't copy the code because anyway the insert didn't succeed.
>
This may have been addressed already, but have you checked the value of nTotLigne at the initiation of the FOR nl = nTotLigne... when it fails or in your testing display something to verify you are actually inside the FOR loop?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform