>I’m locking a document on a table (locks)when user Edits.
>Once the user finishes with editing mode, then I Unlock it. Now the problem is that if the system crashes when in Edit mode then that record will still be Locked.
>How can I Unlock in the event the system crashes?
If you're using RLOCK or FLOCK to do your locks, the network should let go of the lock after a certain period (usually about 10 minutes). Sometimes, in cases like these I've found that you can unlock sooner if you reboot the computer that crashed, get the lock you had at the time of the crash, and then release the lock.