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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to do Real time Data Viewing in application

Status
Not open for further replies.

bracph

MIS
Mar 11, 2008
31
PH
Hi All,

the subject might be too confusing, so to clear... I am thinking of an application to be developed in VFP9 that would do be able to do the following:

1. connect to SQL server as a client
2. multiple user capable
3. Real time reflections of data being updated

the application is some sort of record keeping, that would let users update and view records.. this part is fairly easy, the part that i am encountering problem is the realtime viewing..

i'd like the application to be able to display the current state of a record if that is being updated or not. for example, the user is updating the list of books that needs to be covered, while viewing the list of books, another user is tagging a certain book as being borrowed. on the screen of the first user that is updating the books for covering, that certain book is marked as available, but will changed into borrowed when the second user has finished tagging if for borrowing.

similar function like a chat board, where the screens continuously updates itself.

is this possible in vfp?
 
This is possible in many languages including VFP, but it's not done the way you think it should be. You don't get a realtime monitoring of data, even not within SQL Server management studio. Anything displayed on a client screen is retrieved from the database and already outdated then, in principle, you always need to refresh and requery data. the only thinkg you can do is to redue the time lag. But that's no good idea even with only few clients you would flood the network with data, which actually mostly does not change.

The general solution to prevent double booking or borrowing of itmes is a transaction based system, which SQL Server does provide and VFP and all languages ODBC or OLEDB compliant can use.

A clerk checking out a book in a library system does reserve a book, and if that transaction doesn't fail has assured the book is not borrowed twice. He never can know beforehand, if the reservation succeeds or fails.

Even the fastest refresh of the records on screen wouldn't prevent a double booking in the worst-case scenario, where two clerks act at the same time, each seeing the book unborrowed beforehand. Faster refreshing just might be useful, but it's no guarantee.

Well, and in case of a library typically the reading bringing the book to the cleark already has the best real world reservation, of the book: The book itself. No other library customer can take the same book from the shelve...

Bye, Olaf.
 
...shelf of course. And please also excuse all the other typos...

Bye, Olaf.
 
I have some ideas, might help.

Create table with the USERID, USERSTAT as a field. Anytime a user grab a record for updating, fill the field with appropriate data. When the user finishes the update set these fields back to blanks.

For Viewing continuously: Create another table with the Record key and USERSTAT field. This table is updated as the user start and finish the update. Let us say you have 50 users, and if each user is allowed to update only one record at a time, then create 50 records in this table. Show this table with the timer except blanks.

If system crashes reset the USERID and USERSTATus to blanks.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top