Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP scripting?
Message
 
À
02/04/2007 13:16:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01211369
Message ID:
01211390
Vues:
14
>I have a form with EditBox and few buttons and I am hoping that I can run my form and type in my SELECT statement in the EditBox and I would be able to Query my table in my testdbase.dbc according to my SELECT statement that I have typed in the EditBox. Is this possible? Please help. Thanks, Sam

Hi Sam,
Try this
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


*************************************************
*-- Form:         form1 (e:\ut\form1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   04/02/07 08:59:05 PM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT edit1 AS editbox WITH ;
		Height = 135, ;
		Left = 19, ;
		Top = 35, ;
		Width = 336, ;
		Name = "Edit1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 201, ;
		Left = 119, ;
		Height = 25, ;
		Width = 134, ;
		Caption = "Make query", ;
		Name = "Command1"


	PROCEDURE Init
		ThisForm.edit1.Value = "SELECT * FROM login INTO CURSOR MyCursor"
	ENDPROC


	PROCEDURE command1.Click
		LOCAL lcoldpath, lcmyquery

		lcmyquery = ALLTRIM(ThisForm.edit1.Value)

		lcoldpath = SET("Path")
		SET PATH TO HOME(2) + "Solution\forms\"
		EXECSCRIPT(lcmyquery)

		BROWSE NORMAL

		SET PATH TO (lcoldpath)
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform