Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get result from 3 tables
Message
De
09/02/2011 14:18:01
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Get result from 3 tables
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01499447
Message ID:
01499447
Vues:
78
hi all,

i need help to fix this code to get data from 3 tables, or onther way
if LEN(ALLTRIM(thisform.text25.value)) >= 3
  for i=1 to 3
    cAlias = ICASE(i=1,'mstr2010',i=2,'mstr2001','mstr2011')
  text to cSQL noshow pretext 15 TEXTMERGE
SELECT no,img1 ,EXPBDATE,SDISC,STYPE,ansdisc,expbno from <<cAlias>> 
WHERE atc(trim(thisform.text25.value) ,SDISC)>0 
  INTO cursor TAliascursor1 readwrite
ENDTEXT
&cSQL
		thisform.Grid2.RecordSource=" TAliascursor1" 
			IF i = 1 AND _Tally # 0  
			  thisform.Grid2.RecordSource="TAliascursor1"
			  thisform.grid2.visible=.t.
			  thisform.grid2.enabled=.t.
			  thisform.edit2.visible=.t.
			 EXIT 
		ENDIF 
		IF i= 2 AND _Tally # 0  
			   MESSAGEBOX("Found !!")
			   thisform.Grid2.RecordSource="TAliascursor1"
			  thisform.grid2.visible=.t.
			  thisform.grid2.enabled=.t.
			  thisform.edit2.visible=.t.
			 EXIT 
			 endif
			 IF i= 3 AND _Tally # 0  
			   MESSAGEBOX("Found !!")
			   thisform.Grid2.RecordSource="TAliascursor1"
			  thisform.grid2.visible=.t.
			  thisform.grid2.enabled=.t.
			  thisform.edit2.visible=.t.
			 EXIT 	
			 	
		ELSE
			   thisform.grid2.visible=.f.
			  thisform.grid2.enabled=.f.
			  thisform.edit2.visible=.f.
			  * MESSAGEBOX("Not Found")
		 ENDIF
		
	NEXT 
ENDIF
thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform