Record locking for databases

Does scriptcase support record locking. If not has anyone created any 3rd party code to do so? Running into problems when 2 people edit the same record/

You should manage this with semaphore, you will have full control on the warning or message you want to display

Because all of my database programming software (Foxpro, Dbase, Clarion) handled this I am a bit of a loss. What is semaphore? Thanks in advance for your patience!

Basically you can see a semaphore as a reservation system

You need a table that will contain the reservation info
SemaphoreName
SemaphoreRecord
SemaphoreTime
SemaphoreUser

You also need two function that you can save in the internal libraries, set_semaphore(SemaphoreName, SemaphoreRecord) and reset_semaphore()

Ex. when you want to access a record you first call set_semaphore(“Customer”,345)
the function will check the table to see if the SemaphoreName “Customer” and the SemaphoreRecord 345 is available.

If not available you show a warning that the record is currently used by SemaphoreUser and return False.
If the Semaphore is older than lets say 15 minutes, you remove it to make it available.

If available you create a new Semaphore in the table and return True.

Before you exit your app call reset_semaphore() to remove all the Semaphore you have reserved. You can also call reset_semaphore() from the onExecute Event of the menu to be sure that the semaphore table is as clean as possible.

Thank you so much for your time and in depth explanation! I’m sure I can handle that better now thanks to you.