Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent users from opening the same account
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01036572
Message ID:
01036593
Vues:
9
>>>Hi everybody,
>>>
>>>We're using views with buffering mode 5. The VFP database is on the server. If we want to prevent users on the network from opening the same account, is there some mechanism other than storing currently opened accounts in some intermediate table (file)?
>>>
>>>Thanks in advance.
>>
>>You can explicit LOCK the record(s) on server and then check if the record is locked or not. But this could cause a problems if you plan to port your application to Different DB (MySQL, SQL Server ...)
>
>I think, the easiest and most reliable way to implement it would be to have a TrackingTable in the Database. Some nightly process will have to pack this table. How would it work in case the application crashes?
>
>Thanks.

You can do: (VFP is easier for me then English :o)))
SELECT TrackingTable 
SEEK Account
IF FOUND() && May be someone already works on this account
   IF NOT RLOCK() 
      **** SOMEONE FOR SURE WORKS
   ENDIF
  ** The application for that man/woman who works with this account is crashed, so you can work on the account
ELSE
   INSERT INTO TrackingTable VALUES (Account)
   RLOCK()
ENDIF
There where you leave the account
SELECT TrackingTable 
SEEK Account
DELETE
UNLOCK
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform