Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple Data Sessions
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00316297
Message ID:
00316360
Views:
20
>Hi gang,
>
>I have an unusual situation where an app requires the use of multiple data sessions, the number of which varies each time the application runs. Strangely, this application has NO USER INTERFACE (don't ask, and I won't tell < g > ), so anything to do with forms or the SET dialog won't work. I'm not allowed to rewrite this app, but I've been asked to make some "alterations" < s >.
>
>What I'm looking for is a way to tell how *many* data sessions are currently open and/or populated with an open DBC/table(s)/whatever. Anybody got any brilliant ideas/pieces of code that might accomplish this (ie, get it *off my plate* < BG >)?
>
>TIA.

There is no VFP function that tells you how many and which datasessions are open. If you don't have object references to the forms or sessions objects that "own" the datasessions, the only way I know of to do this is to scroll through all (practically) possible datasessions:
ON ERROR llValidSession = .F.
FOR i = 1 TO 20 && Or whatever number you deem as the maximum possible
	llValidSession = .T.
	SET DATASESSION TO (i)
	IF llValidSession
		* Do whatever here
	ENDIF
ENDFOR
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform