Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSession troubles.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00457954
Message ID:
00457966
Views:
33
>Here is an outline of the code:
>
>
Function CallMe (part of our standard procedure)
>Parameter tcEmpno
>Local lnDS, lnNewDS, lcCallMe
>
><b>lnDS = set('datasession')
>lnNewDS = createobject('session')
>set datasession to lnNewDS.datasessionid</b>
>
>select 0
>use people order empno
>seek tcEmpno
>if found()
>  lcCallMe=iif(empty(termdate),'','*')+trim(callname)+' '+empname
>else
>  lcCallMe=''
>endif
>
><b>release lnNewDS
>set datasession to (lnDS)</b>
>
>return lcCallMe
In addition to what the others have told you, you should not release the object reference while you are still in the DS of that object. You should release lnNewDS after you change back to the original DS. Otherwise, this could leave a dangling reference and not really close the DS [shown as UNKNOWN if viewed in the Session form].

set datasession to (lnDS)
release lnNewDS
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform