?
Solved

Dynamic data display

Posted on 2003-03-04
8
Medium Priority
?
233 Views
Last Modified: 2013-11-13
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.
0
Comment
Question by:navneet77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 

Expert Comment

by:tWiZtEr_RX
ID: 8068951
I dont think there is something as easy as an API dedicated to monitering it.
You can try a timer if you want.
0
 
LVL 2

Author Comment

by:navneet77
ID: 8068961
ya but i do not want to use timer, firstly the refresh will not be immediate and it will waste network resource.
0
 

Expert Comment

by:tWiZtEr_RX
ID: 8069143
use a 1 min. standard timer to refreshes every 60 secs.
and a refresh button.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 2

Author Comment

by:navneet77
ID: 8069218
ya but i do not want to use timer, firstly the refresh will not be immediate and it will waste network resource.
0
 
LVL 3

Accepted Solution

by:
redfordb earned 100 total points
ID: 8077956
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
 
LVL 2

Author Comment

by:navneet77
ID: 8109018
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
 
LVL 3

Expert Comment

by:redfordb
ID: 8109506
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
 
LVL 2

Author Comment

by:navneet77
ID: 8109657
Thanks for the help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

752 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