How to automatically refresh report/datagrid when new entry is entered

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    How to automatically refresh report/datagrid when new entry is entered

    I am using VB6 and SQL Server 2000.
    i want to know how to do this

    we have two/three computers working in our office sql server is installed in maincomputer where we only see the report do not enter data.

    now situaiton is i want that when the clients from the other computer update or enter data in the table even if the report or datagrid is open
    in the maincomputer it should refresh autmatically.

    for e-g suppose we recive an order and on the maincomputer a report is open which shows todays order to be deliver then the data of new order is entered from other computer the on the main computer daily order report should autmatically be refresh and show the current order list .

    i donot know how to refresh datareport/data on datagrid automatically when user enter the data

    i also want to give time stamp how the that the order has been placed
    plz tell me both answers

    thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Try to refresh recordset at a particular time interval.

    Once the other user commits the changes will be refreshed in all the systems.

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      If your Orders Recordset is huge, then Refreshing for at regular intervals (5 mins or so..) may become a tedious and high network traffic. What you can do is Create a new Table with one Field, and Populate that Field With the Last Order Number. This you have to do When you are saving the New Order Entry.
      This table should always have One Record -OneField(Last Order Number) at any given time..

      In Form_load of Datagrid Form, Query for that Number and Save it in FormLevel Variable. Now Start (Enable) a Timer in FormLoad. For every 5 mins, Check for that Field in TempTable. If Your FormVariable <> TempTable.Field Name, Then ReFresh the DataGrid/Datreport.. along with a message to user.
      This logic will prevent you from un-necessarily opening a huge recordset at regular Intervals..

      Comment

      • muddasirmunir
        Contributor
        • Jan 2007
        • 284

        #4
        thanks i will try it




        Originally posted by QVeen72
        Hi,

        If your Orders Recordset is huge, then Refreshing for at regular intervals (5 mins or so..) may become a tedious and high network traffic. What you can do is Create a new Table with one Field, and Populate that Field With the Last Order Number. This you have to do When you are saving the New Order Entry.
        This table should always have One Record -OneField(Last Order Number) at any given time..

        In Form_load of Datagrid Form, Query for that Number and Save it in FormLevel Variable. Now Start (Enable) a Timer in FormLoad. For every 5 mins, Check for that Field in TempTable. If Your FormVariable <> TempTable.Field Name, Then ReFresh the DataGrid/Datreport.. along with a message to user.
        This logic will prevent you from un-necessarily opening a huge recordset at regular Intervals..

        Comment

        Working...