Real Time Programming

Posted on 2002-07-01
Medium Priority
Last Modified: 2013-11-13
Hi There,

I what to do a simple prog.

2 clients with DataGrid connecting to the same Access DB, showing the same table.

I want when 1 client update somting in the table, the other client AUTOMATICLY update the view of his datagrid.

How ?
Question by:computech1
LVL 43

Expert Comment

ID: 7121831
This is a fairly common request, in order to achieve this you need to do one of two things; either create a pull system whereby all clients poll a specific table on a regular basis (many times a second perhaps) and thereby refresh their data or a push system whereby all clients register with a server that then informs all clients when a change has been made.

Either way it is not something that you can just turn on.

Expert Comment

ID: 7121942
Polling is seldom practical or efficient.  Another approach to use (if you want to go deeper) is using a message queue like MSMQ (Microsoft Message Queue).  Comes with Win2K server and allows you to basically setup a simple messaging system.  You would have to have your apps communicating through the message queue informing the other instances of your app when they've updated the table(s).  You will want to probably pickup a book that covers MSMQ (or whatever its called these days) with good examples.  Best of luck.

Regards, Thane Schaffer

Author Comment

ID: 7121990
What about sending simple massage using UDP or TCP/IP ?

TimCottee , can u be more specific ? what do u mean by :
"create a pull system whereby all clients poll a specific table on a regular basis"

U mean all clients will make requery each few sec ?
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

LVL 43

Accepted Solution

TimCottee earned 200 total points
ID: 7122022
Essentially yes, though it wasn't really a serious suggestion as this kind of system ends up generating so much network traffic and also uses a lot of CPU time on each machine making it practically impossible to use.

Simple messaging is really what I was suggesting in a way (without being that precise). The whole point is that you have some centralised location where you register the fact that an update has occured, then you use this to inform all clients that a change has occured and they can then decide whether to refresh the data.

Using MSMQ or some other message queuing system is a perfectly good way of doing this, likewise sending a simple message using Winsock to a list of registered clients would work well. However if you use a method like this you would probably also want to include a time-based refresh method as well to allow for the fact that the server application may not be available or that messages may not have reached the clients in an appropriate timeframe. Using MSMQ should handle much of this as it does "guarantee" delivery of the messages by using handshaking etc.

The question for you then becomes how much (time/money) do you have to spend on this task and whether it is appropriate for the situation.

Author Comment

ID: 7127170
The prob with winsock is that when the list of ppl gets the massage to make update, several access is made to the DB at the same mil sec . the outcome of this : no ALL the clients success to update.

How can I solve it ? Timer dealing the accessing to the DB in a diffrent time for each client ?
LVL 49

Expert Comment

ID: 7970966
Hi computech1,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

computech1, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 8018542
Per recommendation

Community Support Moderator @Experts Exchange

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question