Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add table to Data Environment on run-Time
Message
From
10/12/1996 20:10:11
 
 
To
10/12/1996 09:27:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00014679
Message ID:
00014778
Views:
42
Hi Michael and Arnon thanks for the instance tips. The reason of doing this is I'm trying to include a Customiser Module in my App. so that user can paint their own form and include tables they want. I have try the codes below but error message saying 'Unknown Member DataEnvironment'. What did I do wrong?

x=createobject('FORM')

* Data Environment
x.DataEnvironment.AddObject('cursor1','cursor')
x.DataEnvironment.Cursor1.CursorSource='pyscope'
x.DataEnvironment.InitialSelectedAlias='pyscope'

x.addobject('txt1','textbox')
x.txt1.controlsource='pyscope.cdcomp'
x.txt1.visible=.t.
x.addobject('cmd','cmd3')
x.cmd.visible=.t.

x.show()

read event

DEFINE CLASS cmd3 AS CommandButton && Create Command button
Caption = '\ Cancel = .T. && Default Cancel Command button (Esc)
Left = 125 && Command button column
Top = 150 && Command button row
Height = 25 && Command button height

PROCEDURE Click
sele pyscope
=tableupdate(.t.)
CLEAR EVENTS && Stop event processing, close Form
ENDDEFINE


>>Hi everyone. Like to ask does anyone know how to add a form on run-time with dataenvironment and cursor set. Presently I know how to do the following :
>> x=createobject('form_toolbar')
>> x.addobject('txt1',textbox_)
>> x.txt1.visible=.t.
>> ....
>>
>> x.show()
>>
>>But how do I add object for data environment and cursor. There is example for above in VFP except the ones I'm looking for.
>>
>>Thanks.
>
>assumeing you already have the cflass defenition for the DE
>add a property to your form class the will hold the instance of the DE
>in the load event of the form
>do something like
>thisform.oDE=createobject("myDE")
>now you can do what ever you like with this de instance
>
>Arnon
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform