Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Session Object
Message
From
30/10/1999 00:58:12
 
 
To
29/10/1999 21:16:15
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00283611
Message ID:
00284244
Views:
15
>Hi,
> Becaz I USE the table in myclass, I don want the datasession used in form to be "interrupted".......

You can do this so it won't be. The object doesn't have a life outside of one method call, and all it seems to be doing is opening a file (in the same data session, without protecting the state of the tables in use) and set a logical, and then disappearing. You could accomplis much the same thing with a single method call in the form, something like:

* Your code:
mymethod
>
>DEFINE CLASS loSession AS SESSION
>PROCEDURE INIT
> IF .NOT. USED('User')
> USE User SHARED AGAIN
> CURSORSETPROP('Buffering', 5, 'User')
> ENDIF
>
> SELECT User
> IF SEEK(THIS.UserID, 'User', 'User_ID')
> IF Supervisor
> llPass = .T.
> ENDIF
> ENDIF
> USE
>
>ENDPROC
>ENDDEFINE
>
>loSession.DESTROY
>RETURN llPass
>


PROCEDURE GetUserIsSupervisor
LPARAMETER cUserID
LOCAL lResult, cInAlias
cInAlias = ALIAS()
SELECT 0
USE USER ALIAS (SYS(2015)) NOUPDATE AGAIN
LOCATE For cUser = User_ID
lResult = FOUND() AND Supervisor
USE
IF ! EMPTY(cInAlias)
SELECT (cInAlias)
ENDIF
RETURN lResult
ENDPROC
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform