Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Session object data
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00231653
Message ID:
00231711
Views:
18
Hello Eric,

oc is declared local at top of code, then os creates an od, and then od uses its addobject method to create an object named oc in its init method.

I can issue od.opentables and get the cursors to open, but I thought if autoopentables=.t. the DE should autoopen the tables without me using the opentables method of the DE.

>>Can anyone see why this code is not opening the table custs?
>>
>>local os, od, oc
>>os=create('ss')
>>os.od.oc.getdata
>>os=null
>>
>>define class ss as session
>> od=null
>> datasession = 2
>> function init
>> this.od=create('dd')
>> endfunc
>>enddefine
>>
>>define class dd as dataenvironment
>> autoopentables=.t.
>> function init
>> this.addobject('oc','cc')
>> with this.oc
>> .cursorsource="custs"
>> .database="test"
>> .order="lname"
>> .alias="custs"
>> endwith
>> endfunc
>>enddefine
>>
>>define class cc as cursor
>> function getdata
>> wait window 'Testing...'+custs.cust+':'+custs.lname
>> skip
>> wait window 'Testing...'+custs.cust+':'+custs.lname
>> endfunc
>>enddefine
>
>What is oc? It doesn't appear to be defined.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform