Dynamic data display

Hi,
I am making a multi user application with a central database server. i am displaying some data on a visual basic form, now if another user updates some data on the database i want the changes to immediately show on the vb form. I was trying to do this using dynamic recordset, and i see that if someone insert a new row it is reflected in the recordset but there is no event in recordset which will tell me the someone has inserted new data or changed data.

How can i know in my application that someone have inserted or updated some data in the database so that i can refresh my VB form.
LVL 2
navneet77Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tWiZtEr_RXCommented:
I dont think there is something as easy as an API dedicated to monitering it.
You can try a timer if you want.
0
navneet77Author Commented:
ya but i do not want to use timer, firstly the refresh will not be immediate and it will waste network resource.
0
tWiZtEr_RXCommented:
use a 1 min. standard timer to refreshes every 60 secs.
and a refresh button.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

navneet77Author Commented:
ya but i do not want to use timer, firstly the refresh will not be immediate and it will waste network resource.
0
redfordbCommented:
I did something like this a while ago. It may not be the best way to do it, but it got around the problem...

1. Create a new table in the database.

2. Create a small app on the server side that monitors the database. This program will be a like a server that your app must be able to communicate with.

3. When you access data from the database, insert your conenction number into the new table (you must remove it when your data form is closed).

4. Set up a trigger on the database to fire off the new app when data changes.

5. The new app then reads the new table, and sends a signal off to each of the connections.

6. In your main program, when the refresh signal is received from the server app, you refresh your data.

Like I said it isnt the prettiest way to do it, but it works.



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
navneet77Author Commented:
hi redfordb

thanks for the reply.. i have some question
how will the program on the server communicate with the clients.
what do you mean by the connection number
and how will it signal off to each connection.
0
redfordbCommented:
Look at the "Using the Winsock Control" in HELP.

Basically all you need to do is extend there example so that the server can accept multiple connections. Then when the data changes send some data to all the clients that are currently connected to the server. On the client side when the data arrives it triggers off an event. All you do is put the refresh routine in this event.

You dont even need to insert the connection number into a table. just make an array on the server side, scan through the array and sen the signal to each connection that appears in the array.
0
navneet77Author Commented:
Thanks for the help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.

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.