>Hi Alex, pardon me for jumping in :) , but I have a similar problem. We use the record locking in our current version, but the new version uses views and at a later time will allow SQL server as the backend. I am unable to fit in the locking scheme in this scenario... can it still be done??
Sorry Ashish, but I've never used SQL server. However, if this is a local app (i.e. not running over a wan or anything esotheric), you could create a free table in another server and implement the scheme that way.
If this isn't possible, and be warned that I'm not familiar with SQL, you could implement something with a timer then.
Let's suppose the timer triggers every 15 minutes while app is running:
On timer trigger:
delete any license entries older than 15 minutes
if this computer hasn't 'registered' itself
if reccount() = max_licenses + 3
bounce user
else
let user in
lic = record's primary key
endif
else
get record where primary key = lic
replace field with current time
endif
Every 15 minutes your computer "renews" its lease and checks to see if there are any leases that are older than 15 minutes, meaning that those users crashed or lost their connection for some reason, and frees those licenses.
The extra 3 licenses are a tolerance value that you build in. Perhaps 10 users logged in and 1 crashed. If you try to get back in immediately and didn't have the tolerance, you wouldn't be allowed into the database.
Something along those lines could get you started.
Alex
Low-carb diet not working? Try the Low-food diet instead!