Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data sessions
Message
From
20/02/2005 21:05:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
20/02/2005 20:43:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00988741
Message ID:
00988748
Views:
29
This message has been marked as the solution to the initial question of the thread.
Yes, you can access the same table in different forms, but you will get the same issues as with a multi-user system. In fact, testing with two copies of a form is an excellent way to test for multi-user compatibility.

Specifically, you should SET EXCLUSIVE OFF before opening any table. This allows more than one user (or executable, or form) to access the same table.

>Hi:
>
>I guess there's something I don't understand about data sessions. I thought you could access the same table in two data sessions.
>
>So why am I getting a 'file in use' error in the following scenario?
>
>
>*test.prg
>
>CLOSE ALL
>susp
>loPinfo = NEWOBJECT('testclass','c:\agri\poult\psys30\testclass.prg')
>
>* we're in data session #1
>
>x = lopinfo.testmethod()
>
>* back to data session #1
>
><b>*the next line generates a 'file in use' error</b>
>
>SELECT fm_cpprim ;
>	FROM flckmast ;
>	WHERE fm_flcode = 'BAA12046'
>	INTO CURSOR CURS1
>
>RETURN
>
>
>
>
>*testclass.prg
>
>DEFINE CLASS testclass AS SESSION
>
>	NAME = "testclass"
>
>	PROCEDURE testmethod
>
>* we're now in data session #2
>
>	SELECT fm_cpprim ;
>		FROM flckmast ;
>		WHERE fm_flcode = 'BAA12046' ;
>		INTO CURSOR Curs8
>
>	RETURN 0
>
>	ENDPROC
>
>ENDDEFINE
>
>
>Thanx --
>
>Yossi
>
>
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform