Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert not inserting no more
Message
From
24/08/2014 14:52:07
 
 
To
23/08/2014 08:57:01
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:
01606320
Views:
59
Hello Tracy,

Sorry if I replied two times.

The problem is not with that value. Everything is fine there.

Thanks for your input.



>>>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?
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform