Ado having new changes

I Have an SQL 7.0 table where data are changing every 2 sec. How can I show them into a VB control with ado with out refreshing it each time? Is Very impotent my control not to flash in every data changing. Is there any whey to leave ado open to continuously communicate with my control?
Please answer back.
Who is Participating?
mr_djConnect With a Mentor Commented:
NO. But there are couple of ways to do this if you are familiar with TCP/IP sockets programming or MessageQueue Server programming. But these approches are not trivial, as well as what you are trying to do. The best scenerario would be to not to pull the information(query) from the server, rather use a push model that publish the changed information to the clients. The simplest form would be to write an update trigger that invokes/signal a program that will broadcast this information to clients(Using TCP/IP or Queues).
  Good luck
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I think that the data you are speaking of contains only a few data (otherwise don't do this)
Furthermore, there is no built-in way to do what you want to do.
Please give more details, I can give you my implementation strategy about such things.
papaioannougAuthor Commented:
I have in every record a field that have an amount of money. That field is changing.
The amounts of records in my table are about 400.
The Problem is how can I preview them from a grid with out refreshing the control or the ado because that is creating a lot of problems.

1) Control is flashing.
2) Controls Scrollbar in every refresh is going back to the top.
3) No simple grids can be used because I have to use image in to the fields.
4) Delay in every ado refresh.

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
Maybe I do repeat myself, but:
What you can do is, refresh the grid on user request (using a button), and indicating somewhere on the form, what time the last refresh has been done.
And if really you want to refresh your grid, you may do it, but the interval should be something like 5 minutes (yes, minutes). Think about network: If 10 Users would query your complete table every 2 seconds, this would mean you are transferring (400 rows/2 seconds) * 10 Users * ( [Size per row] bytes ) through the network.
Assuming row is 200 bytes (i don't even think of the image) this would mean:
40 KB per second only for the data. then add the overhead for the communication.
Finally, think that there are other people working on the network too...
Hope this brings you to the good way.
If your customer want's to have this feature, you need to explain him why YOU DON'T WANT TO DO THIS.

papaioannougAuthor Commented:
Thank you for your time and your interest but it's a big customer and a big project and I’m not going to say no, to them. I’ll just explain to them the problem that may come.

Can you please send me a sample code as an example to understand the concept of your proposal?
Guy Hengel [angelIII / a3]Billing EngineerCommented:
papaioannoug, even if it is a big customer, you will sometimes have to say no AND explaining why you say no.
I assure you that this part of the app will fail, even if approaching with MessageQueue or TCP/IP methods.
The method will reduce the amount of data to be transferred, but not necessary enough to take really advantage of it (i had such a failure, so be warned)
Best wishes for your project.
My two cents here...
It might be done, by using UDP (Uniform Datagram Packets if memory serves <g> ) This is a connectionless protocol that works under the TCP protocol. It is quick and uses no validation on contents of connection at all.
These UDP packets with the changed data that will have to incoorporate themselves into a Grid on the client.
You'll need to:
-Take a normal grid, or build a grid yourself that can hold pictures
-Fill this with the startup information. (Now remember you cannot link the ADO rs to the grid, only the values)
-Have your clients set up with a winsock socket that listens to UDP packets.
-Have your server transmit changes by UDP and let the clients pick them up. and set them into the grid.

As you see, not a trivial matter, but one that works.

Try using Requery method on your recordset
Guy Hengel [angelIII / a3]Billing EngineerCommented:
sbmc :
please read my second comment
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.

All Courses

From novice to tech pro — start learning today.