Real Time Programming

Posted on 2002-07-01
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 ?
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

LVL 43

Accepted Solution

TimCottee earned 50 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

773 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