Link to home
Start Free TrialLog in
Avatar of Idarac
Idarac

asked on

Foxpro for DOS 2.6 record locking

I have been asked about record and file locking in Foxpro for DOS 2.6. What would be the best way to approach record locking for record writes/updates? What about file locking?
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

It's like asking what is the best way to use a kitchen.

The topic locking is a bit narrower, still if you ask this question without telling what you expect of locking and how your application should work, you better first read about what locking can do for.

First of all locks are only needed for multi user environments. Is your dos app multi user at all?

Bye, Olaf.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The usual approach to locking a single record:

IF RLOCK('table')
    DO stuff
    UNLOCK IN table
ELSE
    WAIT WINDOW "Record is locked by another user".
ENDIF

Open in new window

Avatar of Idarac
Idarac

ASKER

Great answer