Hi there.
first of all if you find the record (IF AVAIL cntrct), then why are you creating (create cntrct) another one.
Second of all when you write to the database, you can't use no-lock, you have to use exclusive-lock.
Let me know if you have any problems, maybe we can exchange email or ICQ...