Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know records were edited or deletion by Other use
Message
 
 
To
18/10/2000 11:25:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00430813
Message ID:
00430960
Views:
12
>Hello Nadya,
>
>>Could you please expand your idea a little bit more? How do you lock records in your application?
>>
>
>I use rlock() < bg > (I know you know that part)
>
>>In our applications we lock records, but not in all cases. Sometimes two users may change the same record in a time. In this case, who hits Save later, he/she saves.
>
>It depends on the situation. If the screen is an invoice entry screen (not a query), I lock the record as soon as the user pulls up the record. Same thing for screens such as Customer File Maintenance. These are not query screens...the very fact that the user pulls up the record using these screens shows intent to edit the record, so I lock the record. Of course, I unlock it when they save the record.
>
>If you are concerned about users locking a record and walking away, you can use a timer to unlock record and change the state of the form (so they will have to do something to get control of it again). When the timer unlocks them, you could even store the changes they have made to an object or a temporary table, so when they get back they don't have to start over. I don't go to all this trouble, but may need to in the future.
>
>If you want to design it so they can edit a record that the may have been 'just looking at' (eg, they are viewing a customer record in a query to get an address, and they notice that it is misspelled), you can make all of the controls read only, and put an EDIT button on the form. At that point in time, you make the controls read/write, and you lock the record. The user has said, "This record belongs to me".
>
>Another option is to start with the controls read/write, and lock the record as soon as the user makes a change in one of the controls. This would take a little more work to set up in your base classes; I've never explored this method.
>
>Am I covering any of the situations you have in mind?

Thanks a lot, Steve. Our baseform class has editmode, so if a user switches to editmode, we can lock the record. We can even put this logic in EditMode_Assign method. But it should depend on importancy of the form and changes, so perhaps we can not handle it on a class level or add a new property (ImportanceLevel or similar to our class).

Thanks, I would keep this idea in mind and see, if we implement it.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform