Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding DataEnvironment to a form programmatically
Message
From
13/02/2002 22:46:21
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Adding DataEnvironment to a form programmatically
Miscellaneous
Thread ID:
00619865
Message ID:
00619865
Views:
74
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
Next
Reply
Map
View

Click here to load this message in the networking platform