Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record lock issue
Message
 
 
À
28/08/2008 18:04:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01342876
Message ID:
01342878
Vues:
49
Why you're not using SCAN here? FOR is a bit strange loop through the table.

Also what exactly is the purpose of this code? To lock a record? I looked at this code couple of times and I can not figure out what it is doing or supposed to do.


>Hi everyone,
>
>This issue is really driving me crazy.
> I have very simple code that runs at the beginning of my application, it calculates number of records that are locked in a table and when it riches the end it will add a new record place a lock on this record and exit. It also might a record which is not locked, then instead adding a new record it will use this record to place a lock.
>Here is the code
>
>SELECT UserCount
>lnReprocess = SET("REPROCESS")
>*--repeat attempt to lock once
>SET REPROCESS TO 1
>pnLocRecord=0
>pnactivecount=0
>*-- pnMaxUsers = 5
>FOR i = 1 TO pnMaxUsers
>    IF EOF()
>        APPEND BLANK
>    ENDIF
>    IF RLOCK()
>       *--save locked record
>       pnLocRecord=RECNO()
>       EXIT
>   ELSE
>       pnactivecount=pnactivecount+1
>   ENDIF
>   SKIP
>NEXT
>SET REPROCESS TO (lnReprocess)
>
>Today I have a user reporting an issue when the process hangs.
>It only involves two particular machines. If one of the machine is already logged in into the system the other one will hang on the RLOCK() statement. Both machines are running Vista OS.
>Any one has any idea is to what can be the problem here?
>
>Thank you
>Yelena
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform