Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shared option in USE command
Message
De
23/09/2014 06:58:22
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01608037
Message ID:
01608038
Vues:
55
>May sound trivial, but I am Just trying to better understand what the SHARED option does in the USE command.
>
>It seems to me that the SHARED option is already embedded in USE command, since I can USE a file across a network already, without having to specify the SHARED option. Almost all the tables I open in a Multi-User environment don't have the SHARED option, and they are all open across the network, no problem.
>
>So my question is, what are the trade offs of using the SHARED option in a USE command ? - What do I lose?, what do I gain?

USE .. SHARED opens a table in non-exclusive mode, even if SET EXCLUSIVE is ON.

>Here's why I need to know. Only in one part of the code where I am centrally recoding "The last issued serial #', I have a
>USE table IN 0,
>command, and in a multi-user environment sometimes they get the error
>Error: File is in use by another user.
>
>So, I am trying to figure out, how can I eliminate this error?

Someone is opening the table (assuming it's a table) in exclusive mode. If that shouldn't be occurring at all, then SET EXCLUSIVE OFF or USE table SHARED in the part of your code that does not explicitly opens the table in non-exclusive mode.

Note that DELETE and RENAME also require exclusive access. The same error will trigger if you attempt one of these on an opened file (regardless of exclusiveness mode).
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform