Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to display real-time data?
Message
 
To
22/05/2002 04:47:24
Hisham Serry
Al-Bahar United Company
Kuwait, Kuwait
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00659547
Message ID:
00659911
Views:
29
>can you give me more details about this Nick because I have the same problem, so could youclear it.
>
>I have also taxi system which the control room has an form which contain the grid and I have table for the taxi orders, and I would like to use this real time data, now I'm using a timer but it is not good idea because I have to go to the same record again if he is browsing the grid when the view is refreshed, in the case of requery it gose to the first column, so any idea about this with full details.
>
>thanks nick

Hi Hisham,

I see what you mean. From one point of view the grid should be constantly refreshed to display the most recent data which means that the number of records and records positions in the view may changeand also after REQUERY() the erecord pointer goes to the first record. At the same time (from another point of view) the user should be able to navigate through the records doing his work and when the view/grid is refreshed s/he wants to stay on currently selected record.

I cam make some guesses for possible scenarios as I don't know more details on your work scenarios.

One solution (which is probably what you are doing) is to remember some key fields from the current record in grid.AfterRowColChange() and after the REQUERY() add come code (simple LOCATE should be enough for small view recordset) to automatically return to the previously selected record. Or stay on the first record and warn the user if the previously selected record is no longer in the refreshed view recordset.

This scheme should work fine with the timer. Another way may be: not to update the grid automatically, but have another SQL select identical to the view definition which you requiery first and somehow compare with the current view data, then warn the user that the data has changed, so s/he could manually refresh the grid after s/he finished what s/he was doing.

There may be a combination of both (depending what is done to the view data) If it is non-updatable view or the view data were not updated yet, then refresh the data automatically and return to the previously viewed record. In case of updatable view - if the view record was being updated by the user when the refreshed data came in - then warn the user and let him finish the update first.

Again, there may be other ways, depending on your work scenarios.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform