Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for Open File
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01097778
Message ID:
01097814
Vues:
19
>I can already see that I should have completed the filename with the .dbf on the end, in order to make this work properly.
>
>
>*** 02/21/2006 Cecil Champenois. We need to set this up so that the user
>*** waits here until the following Production file is able to be opened.
>LOCAL lcFileName, lcMessageText AS Character
>LOCAL lnSuccess AS Number
>#DEFINE NREADWRITE 12
>lcFileName="E:\PRODUCTION\DATA\PRODUCTION.DBF"
>lnSuccess=FOPEN(lcFileName, NREADWRITE)
>=FCLOSE(lcFileName)

Now another user open the table.


>IF lnSuccess < 0
>	MESSAGEBOX(lcMessageText, 0, lcTitleText)
>ELSE
>	* The file is not being used by anyone so, open it now.
>	USE (lcFileName) EXCLUSIVE ALIAS PROD_E
>ENDIF
>
use this:
local lnSuccess
do while not m.lnSuccess
TRY
  USE (lcFileName) EXCLUSIVE ALIAS PROD_E
  lnSuccess = .T.
CATCH
  lcMessageText="Field is in use by another user."
  lcTitleText  ="Please wait for file to be available"
  MESSAGEBOX(lcMessageText, 0, lcTitleText)
ENDTRY
....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform