Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Tables on a Network
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00022021
Message ID:
00022032
Vues:
45
Teshome,

In addition to Barbara's fine notes below I suspect that you may be misconstruing "running on a network" (please pardon me if I am mistaken].

You say ". . .even though I have done so as you can see. . .". Well, IF you expect that an OPEN on one workstation should result in the file being opened on any other workstation, then your expectation is wrong.
In other words, an OPEN must be performed on EACH workstation where you want to work with the file

Good Luck
Jim N.

>>Hello Folks,
>>
>>My application (in VFP3.0) works fine on a stand-alone machine but does
>>not work when running on a network. It asks me to tell it what table to
>>open eventhough I have done so as you can see in the lines below.
>>
>>It is acting as if the "SHARE" statement is not working.
>>
>>Any online or offline help would be greatly appreciated.
>>
>>TJ
>>
>>Here is the snippet:
>>============
>>*** OPEN THE MAIN DATABASES
>>
>>IF USED("tms")
>> SELECT tms
>> SET ORDER TO TAG main
>>ELSE
>> SELECT 0
>> USE (LOCFILE("tms.dbf","DBF","Where is tms?"));
>> AGAIN ALIAS tms SHARE
>> SET ORDER TO TAG main
>>ENDIF
>>
>>IF USED("taskee")
>> SELECT taskee
>> SET ORDER TO TAG ord_factor
>>ELSE
>> SELECT 0
>> USE (LOCFILE("taskee.dbf","DBF","Where is taskee?"));
>> AGAIN ALIAS taskee SHARE
>> SET ORDER TO TAG ord_factor
>>ENDIF
>>===========
>
>You have a couple of misunderstandings about how the USE command is written.
>
>First, you only need to use AGAIN if the file is already open.
>
>Second, VFP will default to exclusive use of a file unless you use the 'SET EXCLUSIVE OFF' statement.
>
>Third, by including your locfile() function in the USE statement, you run into the way VFP handle items in parentheses.
>
>So, here's my change of your first set of code:
>
>** First make sure all files can be shared
>SET EXCL OFF
>
>** Check for file already open or not as before
>IF USED("tms")
> SELECT tms
> SET ORDER TO TAG main
>ELSE
> SELECT 0
> ** Now get the file location for tms.dbf
> cFile = LOCFILE("tms.dbf","DBF","Where is tms?")
> ** USE the file. Note that the parentheses enclose a variable
> ** file name
> USE (cFile) ALIAS tms
> SET ORDER TO TAG main
>ENDIF
>
>Working with the Name Expressions (a variable name in parens) is not always intuitive. Read the Help on Macro Expressions and Name Expressions.
>
>HTH
>Barbara
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform