I'd like the users to browse all data in db as freely as possible,
but when a user wants to edit a record, she has to lock it first
and the record remains locked as long as she has not finished (=
release). If another user tries to edit the very same record, she
must have a message saying that she cannot edit this record because
it is locked.
Well, maybe you already know this, but (unless I'm mistaken) when you
are using Recordset, the record is locked from when you call Edit to
when you call Update. Someone please correct me if I'm wrong.
db as MySQLDatabase
rs as RecordSet
rs = db.SQLSelect("SELECT * FROM myTABLE WHERE ID = " + theID)
rs.Edit // the returned record is locked
rs.Field("someField").Value = "SomeValue"
rs.Update // record is unlocked here
db.Commit // or possibly here?
And then, I suppose you could maybe generate a "record is locked"
message by testing the Update (I don't have the LR in front of
me...does it maybe return Boolean?) or by adding a line after the
update that tests to see if the current value matches the value you
were trying to update.
Hope That Helps,
Ian
p.s. Somebody please call me out if I'm way off here!
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>