Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding DataEnvironment to a form programmatically
Message
De
13/02/2002 22:46:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Adding DataEnvironment to a form programmatically
Divers
Thread ID:
00619865
Message ID:
00619865
Vues:
75
All,

I am using VFox5a.

I am working on adding DataEnvironment to a form programmatically. When I run program, I got “error instantiating cursor object” message. The bellow is copy of prg code. Any help on this would be much appreciated.
Public oForm

oform=CreateObject("myform")
oform.show
read events
Return

define class data1 as dataenvironment
	add object oCursor as mycursor
	Procedure Init
		This.OpenTables()
	EndProc

	Procedure Destroy
		This.CloseTables()
	EndProc

enddefine

define class mycursor as cursor
	database="mydata.dbc"
	cursorsource="mytable"
	alias="mytable"
enddefine

define class myform as form
	top=0
	left=0
	width=486
	height=586
	docreate=.t.
	caption="form1"
	datasession=2
	dataenvironment=""

	procedure unload
		clear events
	endproc

	procedure load
	        this.dataenvironment=createobject("data1")
	endproc
enddefine
Many thanks
Manoj Karki
manoj0karki@yahoo.com
Nepal
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform