|
-
September 26th, 2002, 04:45 AM
#1
"Real-time" view updating
Hello there
I got a question for all gurues roaming out here. I have a database, and a program that read some tables and displays them in a CView-derived window. The user can update the database from there and every opened views are also correctly updated, no problemo this far. The question is : imagine I have the same program running on another machine of the network, that displays the same records at the same time. What would be the trick to tell the other computer it should also update the views? More generally, is there an efficient way to always have an up-to-date display of the database content on any machine without making requirys loops of something like that??
Thanks in advance for any help
Rolf
-
September 26th, 2002, 04:56 AM
#2
Maybe you can use a COM Server:
Every Client registers on that server for "listening"
After every database update, the COM Server is informed and fires a corresponding event to all registered clients
-
September 26th, 2002, 05:02 AM
#3
Originally posted by corcor
Maybe you can use a COM Server:
Every Client registers on that server for "listening"
After every database update, the COM Server is informed and fires a corresponding event to all registered clients
OK, I see.
That would then involve the use of an external program that (I guess) should run as a service on the database server. Sound a bit complicated for me as I'm not very confident with COM programs. Any sample somewhere?
Thanks for your answer
Rolf
-
September 26th, 2002, 05:14 AM
#4
There's no need to run as a service.
The first client starts the server, when the last client closes, the server is unloaded (you don't have to care about that, everything is handled from (D)COM)
Unfortunatly I've no sample, but there are some COM / ATL samples in MSDN how to create client & server, automation and how to fire events. That would be a good starting point, I think.
-
September 26th, 2002, 05:15 AM
#5
Originally posted by corcor
Maybe you can use a COM Server:
Every Client registers on that server for "listening"
After every database update, the COM Server is informed and fires a corresponding event to all registered clients
OK, I see.
That would then involve the use of an external program that (I guess) should run as a service on the database server. Sound a bit complicated for me as I'm not very confident with COM programs. Any sample somewhere?
Thanks for your answer
Rolf
-
September 26th, 2002, 05:20 AM
#6
Originally posted by corcor
There's no need to run as a service.
The first client starts the server, when the last client closes, the server is unloaded (you don't have to care about that, everything is handled from (D)COM)
Unfortunatly I've no sample, but there are some COM / ATL samples in MSDN how to create client & server, automation and how to fire events. That would be a good starting point, I think.
Oups sorry, made a mess with IE and it reposted my last message
Anyway, I still have one question concerning your solution. Let's say I got my database on a server called Svr1. I got 2 clients on PC1 and PC2. I start my program on PC1. THe progy then starts the COM server. PC2 starts the client program too and "sees" there is a COM server on PC1, ans makes a connection.
THis far, it's clear for me. But what happens if I shutdown PC1 ? The COM server will be unavailable for the other users no? Should this COM stuff not be started on the database server to ensure continuous work??
Thanks again
Rolf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|