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:
00025989
Vues:
34
Hi Barbara and Jim

I just saw the reply you gave me for a post of a month ago.
My account has some kind of a problem. I did not see my post
nor your replies email-wise. So I just checked the web and saw
them tonight.

I just wanted to take this opportunity to thank you for your
thoughtful responses.

TJ

>>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