Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two apps, with grid updating same table and getting refreshed periodically 1

Status
Not open for further replies.

Rajesh Karunakaran

Programmer
Sep 29, 2016
535
0
16
MU
Hi friends,

I have two applications. Both have a grid with the same underlying table in buffered mode. Different users are updating the table records. The grid in both applicaions are being refreshed using timers in them.

Now, suppose the Amount in a particular record was 100. One user is tring to edit that Amount to 200. Now, if the timer triggers at that time, the value gets back to 100, because the timer refreshes the grid.

Another thing, a bit more complex, is that another user may be editing ANOTHER RECORD Amount to some other value and that has to be refreshed correctly in the first user's grid, because he has not trying to edit it and he should see the LATEST value entered by other users.

Ultimately, I think, when the timer refreshes the grid, if I can avoid Refreshing the currenly selected record (the record pointer), then my goal can be achieved.

How I can handle such a situation? Is there any way? Either systematic and know or a tricky one.

Rajesh
 
Chriss,

Chriss said:
Have you tried this example?
I have not yet tried your example. Really held up in something else.
Will certainly check that and update you all.

Thanks.
 
I haven't read the thread, so sorryif this has already been suggested:

Don't let them edit in the grid without entering an edit mode. And when they do, start trying to create locked_Nnnnnn.txt files on the data drive for every row you navigate to. Use dynamic coloring and enable or disable editing based on what records are locked by other people.

On column changes, write out the new values to an unlocked parallel locked_Nnnnnn_data.txt file if you want to sample what the record has been changed to before it's unlocked.

On row changes, unlock the previous iid's record (the Nnnnnn value) and delete it, and try and create the new one. Dynamically set everything if you can. If so, great. If not, dynamic coloring and readonly flags for that row.

A subclassed grid setup one time holds all the syncing code. You can use it everywhere. Just include some unique static identifier on every grid instance and include it in the locked filename.

You'll never have any data collisions that way, and it will be visual. And no special record locking in VFP.

--
Rick C. Hodgin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top