Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help. The Destroy event of my session object keeps firing
Message
From
09/01/2001 05:38:19
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Help. The Destroy event of my session object keeps firing
Miscellaneous
Thread ID:
00461058
Message ID:
00461058
Views:
49
I am trying to create my first business object based on a session object.
When I use it from the command line it works fine.

How ever when I try to run it from the load event of my form, the session object's destroy event runs and clears out my data session.

I think this is because the form is trying to establish its own private data session.

I have the form set to private data session.

What am I doing wrong here.

Many Thanks










****
******************************************************************************
* This prg contains all the programmatically created classes that are used with IJCTND


********************************************************************************************
* Data Session Class.
* Most of the Biz Objects below are based on this data session class
********************************************************************************************
Define CLASS DSClass AS Custom
*oSession=0
Hidden oSession &&=0 && You don't want people to be able to change this
DataSessionID=0
Procedure Init
Lparam lcSessName
This.oSession = CREATEOBJECT("Session")
This.oSession.Name = iif(vartype(lcSessName)='C',lcSessName,"DataSession")
Set DATASESSION TO (This.oSession.DataSessionID)
Wait window This.oSession.Name+ ' (' + trans(set('datasession')) +')' nowait
this.DataSessionID=This.oSession.DataSessionID
Endproc

Procedure UseTable
Lparameter tcTable

If NOT USED(tcTable)
Use (tcTable) IN 0
Endif
Endproc

Procedure Destroy
SET STEP ON
Close DATA ALL
This.oSession = .NULL.
Endproc

Enddefine

***************************************************************
* This class is a sub class of the data session class
* It outputs a tender as a set of tables ready for dispatch.
****************************************************************
Define CLASS prepfiles as DSClass
*oSession=0 && You don't want people to be able to change this

Procedure TEST

Wait WINDOW 'I AM TEST IN THE SUBCLASS'

Endproc



Enddefine
Next
Reply
Map
View

Click here to load this message in the networking platform