Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How SQL Server send message to any instance of application

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-13 : 19:28:06
Ivailo Jelezarski writes "I'm sorry but I don't know English very well.
I hope that you can understend my question.

Now i write client-server application with Borland C++ Builder 5.0.
and Microsoft SQL Server 7.0. The server is NT Sever 4.0 with SP6.
My program connecting throw the LAN with SQL Server. There is two
ore more terminals using data base. I retrieve table on the server
in a String Grid in my application. I would like to learn when one
client make a change in this table how the other clients can learn
for this.
My question is:
How SQL Server send message to other therminals and how i can catch
this message in any instance of my application on that terminals?

I've tried following:

I create trigger FOR DELETE,INSERT,UPDATE on a problematic table.
In that trigger using PRINT or RAISERROR i send message when there is
a change in a table. I tried to catch this message using DB-Library for C
functions:
DBERRHANDLE_PROC dberrhandle(DBERRHANDLE_PROC err_handler );
DBMSGHANDLE_PROC dbmsghandle (DBMSGHANDLE_PROC msg_handler );
There's no effect.

Then I tried create extended store procedure using Visual C++6.0.
This procedure send message using
int srv_sendmsg (SRV_PROC * srvproc, int msgtype, DBINT msgnum, DBTINYINT class,
DBTINYINT state, DBCHAR * rpcname, int rpcnamelen,
DBUSMALLINT linenum, DBCHAR * message, int msglen );
I successfully create this procedure. I again tried send message with
it - failure. This SRV_PROC * srvproc is the handle for a particular
client connection and send the message only to that terminal who is
made a change. The others?



Any information about this problem is very imporant for me.
Thank you in advance!"
   

- Advertisement -