Updating Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lotus18
    Contributor
    • Nov 2007
    • 865

    Updating Database

    Hello World

    Hi, Its me again. I have a local database which serves 4-6 computers. Every time there are changes with the table (e.g. modified by computer 1). How can I update the database automatically without clicking the Refresh button? All we know that every time we view all the list we need to open the connection and then close it again, right? So, how can I handle this problem? Please help. Urgent. Thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    If the data in the table gets changed ,why you need to update it again.

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by debasisdas
      If the data in the table gets changed ,why you need to update it again.
      No, I just want to automatically refresh the data (e.g. modified or added new data by computer 1) for all the computer connected. So that I will not always click and click the Refresh button all the times. Hope you undersand

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        Hi Debasisdas, some forums told me to use filewatcher API. Do you have any ideas?

        Comment

        • jamesd0142
          Contributor
          • Sep 2007
          • 471

          #5
          I don't know how to do it but my idea is...

          Use the filewatcher on a timer, run every(x seconds) if the database file is modified then button refesh.performc lick.

          Could that work?

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            If a single database is serving to multiple systems and the data is updated by any system , how it is not updated for others . How is that possible ?

            Comment

            • jamesd0142
              Contributor
              • Sep 2007
              • 471

              #7
              I think if computer1 and compuer2 both retrieve data at the same time, and computer1 changes a field, compuer2 is looking at old data.

              Mayb thats what he means...

              Comment

              • debasisdas
                Recognized Expert Expert
                • Dec 2006
                • 8119

                #8
                If the user1 changes the data, the user2 will keep getting the old data till user1 commits the transactions. This process (commit) should be part of the application itself.

                Comment

                • lotus18
                  Contributor
                  • Nov 2007
                  • 865

                  #9
                  Originally posted by debasisdas
                  If a single database is serving to multiple systems and the data is updated by any system , how it is not updated for others . How is that possible ?
                  I think you didn't understand me ~ ~. Anyway, yes, the data is updated of course evertime there are changes, but how can I automatically refresh the data on all the PCs EVERYTIME when the computer1 (or computerN) modifies a certain data without clicking the refresh button of the other computer? Everytime I (or other users) want to see the most current data I'll have to click the refresh button. I think this is quite complicated but I'm hoping this time you understand.

                  Comment

                  • daniel aristidou
                    Contributor
                    • Aug 2007
                    • 494

                    #10
                    Originally posted by lotus18
                    I think you didn't understand me ~ ~. Anyway, yes, the data is updated of course evertime there are changes, but how can I automatically refresh the data on all the PCs EVERYTIME when the computer1 (or computerN) modifies a certain data without clicking the refresh button of the other computer? Everytime I (or other users) want to see the most current data I'll have to click the refresh button. I think this is quite complicated but I'm hoping this time you understand.
                    Well.... sounds interesting.... you could try a timer on the form..... lets say every minute it refreshes the grid automatically.
                    I think this question could be answered by the access forum...... i'm sure they probably have some code to do this
                    though u might consider each computer....... sending an automation message to the other computers when somebody updates the database...... after which the grid is updated automatically

                    Comment

                    • jamesd0142
                      Contributor
                      • Sep 2007
                      • 471

                      #11
                      How about have a seperate table in the database. with one value for each computer, when a user updates the database change the value of this field.

                      comp1 0
                      comp2 0
                      comp3 0
                      comp4 1
                      comp5 0
                      comp6 0

                      then use a timer to check these values and if any1 of them is a '1' then refresh/reload the data. But only reset the actual record to '0' for the computer thats requesting the data. so you can be sure all computers are recieving the updated data.

                      only problem here is you will need to custom make this function for every terminal.

                      Still its a possiblility.

                      Comment

                      • lotus18
                        Contributor
                        • Nov 2007
                        • 865

                        #12
                        Originally posted by daniel aristidou
                        you could try a timer on the form..... lets say every minute it refreshes the grid automatically.
                        If I'm going to try this, the user can only manipulate the data (add, edit, delete) every minute. And one more thing, this method cannot handle a mass quantity of data. All I want is to view immediately the data after it has been added or modified without clearing the whole list then populates the data.

                        Comment

                        • daniel aristidou
                          Contributor
                          • Aug 2007
                          • 494

                          #13
                          Ok.......theore ticly this should work...in practise i dont know
                          1.)create a new table (Updates) with exactly the same fields + 4 Boolean fields corresponding to each computer.
                          2.) When a new record is added it is inserted to both tables + the corresponding boolean field is set to true
                          3.) Create a trigger for the table updates (unfortunately i can't help you here but it does exist) (This sends a automated message on update insert of a table)
                          4.) when each computer recieves a trigger message it checks the update table
                          if its corresponding boolean field = false if so it adds it to the grid and sets its boolean field to true else it ignores the record
                          5.) when all 4 boolean fields = true for a record it is deleted from the update table

                          Comment

                          Working...