4 Replies Latest reply on Jun 8, 2009 12:28 PM by UncleGeo

    Making local fields automatically equal to remote MySQL fields

    UncleGeo

      Title

      Making local fields automatically equal to remote MySQL fields

      Post

      I have a connection to an external MySQL database through FM Pro 10. I have a local table and a remote (MySQL) table related via an "item" key -and that's working fine. I'm paranoid about losing the remote data, or having the remote data corrupted, and/or not seeing it because my connection might be down, so I'd like to have fields in the local FM database table that have the same info as the remote fields. Kinda like an offline backup insurance policy.  This way if I can't get online I can still see my data when customers call.

       

      What is the best approach? And are there ways to automate this so it just happens?

      • Ideally, I would enter data in the remote fields and it would showup in the local fields as soon as I exit the remote field. And then it would stay there even if the remote DB changed. This should happen in a new record or when I change data in an old one.
      • Less ideally would be a script/button that copies all the data from the remote fields to the local ones. 


      I know I can't just set the local field to = the remote because then if the remote table is corrupted so is my local one.

       

      Part of my question is what the right approach is and part is the how to. I just bought FM 10 after using FM 6 for a zillion years so I'm trying to wrap my feeble brain around this new world.

        • 1. Re: Making local fields automatically equal to remote MySQL fields
          kapitaen_1
            

          does mysql do something like mirroring or replication on server or database level? i dont know. if yes, this would be "best practice".

           

          and something like a "clone database scheme" must be done by hand, field by field, but then you can import from your external data source to filemakers internal table.

           

          have a close look at utf8 fields, maybee they get corrupted characters by direct import ( i didn´t see any utf8-option by direct importing from table to table).

           

          greetings from germany

          chris 

          • 2. Re: Making local fields automatically equal to remote MySQL fields
            UncleGeo
              

            Not sure if FM mirrors, can't find anything on that. I could just back up everything which I need to do anyway. But It would be nice to have this all happen in real time and in the record. I have not had a problem yet with corruption I'm just a worrier. It just seems I ought to be able to keep the data locally as well as in the MySQL database without having to copy every field.

             

            I may just write a script/button so when I am done entering data in the remote fields it would just copy them over to the local ones, and maybe warn me if I try to leave the record without doing it.

             

            I just get this feeling FM will do what I want it to. I'll keep poking around.

             

            And hope things are well in Germany! It's kinda cool all us folks around the world helping each other out. I hope I can return the favor someday!

            • 3. Re: Making local fields automatically equal to remote MySQL fields
              kapitaen_1
                

              dont try o let filemaker to mirror your date, it can´t.

              have a look at mysql if it can mirror your data. one mysql server at the central, and over your connection a second mysql server with the mirror (or replicant) data at your remote place. and at your remote place let filemaker connect to the remote sql server with the mirrored data.

              the plus ... when your connection breaks, filemaker doesnt see that it is broken and will continue work. when the connection reconnects again, the mirror mechanism will actualise your central machine with the mirror machine and vice versa. so can be done with sql server. if mysql can, you must find out yourself.

              the minus ... using serials as record identification will make problems, especial when the connection breaks. you better user uid fields.

               

              tired greetings from germany, it is ten past midnight now here ;-)

              chris

               

              ps.: no, i am not in dresden ;-(

              • 4. Re: Making local fields automatically equal to remote MySQL fields
                UncleGeo
                  

                Kapitaen,

                 

                Thanks, I think I'll just write a script to copy the remote fields into local table fields.  I will see them side by side so I can make sure they are the same.