Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data sessions
Message
De
20/02/2005 21:05:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
20/02/2005 20:43:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00988741
Message ID:
00988748
Vues:
30
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform