CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    3

    Refreshing data 'real-time"

    I need some advice on a method to produce real-time or close to real-time data refreshing in my VB6 application. The application has a visual display using MSHFlexGrid of inventory available for theater seats. A number of order entry clerks can be accessing the data at the same time.

    How can I refresh the data display when changes are made, so that the clerks see real information and don't run into conflicts? Ideally, I'd want each client workstation to send a message to other workstations when the data updated. But what's realistic in VB?

    I've thought about a few different methods, but none seem that attractive. And I don't want to go down a deadend. What do you think is the best way to acheive this?

    Some of my thoughts:

    1. A DCOM/ActiveX thing that acts asynchronously (would require enormous learning on my end)

    2. Upgrade to VB.NET and use tools that it has?

    3. Set a timer to refresh the page. But what cost in processing power, etc?

    4. Find a control that will work with little modification

    5. something simple that I haven't thought of yet ...

    Thanks

  2. #2
    Join Date
    Feb 2000
    Posts
    440

    realtime

    How about a winsock control and UDP protocol. Each time a seat state is changed the station that is affected broadcast message, all others are updated.

  3. #3
    Join Date
    Sep 2003
    Posts
    3
    Thanks ... going through the Winsock stuff now, that looks like a reasonable way to do it (and much easier than my other ideas) ... will probably have some questions once I start

  4. #4
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901
    There is an API which triggers an event when a change is made to a given directory.

    In your case, all that needs happen is that when a Seat is allocated this will cause a change in the Seating Database which will trigger the change event in the Watch Directory program, which will then trigger you to refresh the Grid.

    Have a look at the attached file - it works so well!
    Attached Files Attached Files

  5. #5
    Join Date
    Sep 2003
    Posts
    3
    Thanks George. How could I do that for just one table (in SQL Server)? Is there another API for that or would I have to put it in a different directory, or?

    Thanks for the input -- sorry to be so newbie-ish, but I'm stretching myself to learn this all quickly. [I've finally given up programming in Paradox and dBase ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured