>>>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()
IF NOT RLOCK()
ENDIF
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.