5 Replies Latest reply on Mar 24, 2010 5:34 AM by pguerett

    Submit data to MySQL localhost

    Shailevit Level 1

      Hi,

       

      Is there a way to create a submit button to submit the data to the MySQL database on the localhost - not via HTML, XML or other web method. I created a form to be filled out on local client system - each form is correctly set-up in the binding to the proper MySQL table (connections work). So when I looked at the Button for submission, It's XML, XML, PDF, URL. Also in the biding of each field, I could only create the defauly binding, not the Import/Export binding (Execute), since it would only allow a WSDL file connection, not a OLEDB DB connection, like I did in the default of each field. In the data view I can see the correct field and assignment - So I know it would work if I could send the data.

       

      SO..... How do I create a submit button to send data ffrom the PDF to the local MySQL database?\

       

      Many thanks guys.

        • 1. Re: Submit data to MySQL localhost
          pguerett Level 6

          Using that same ODBC connection you can use the create method to cause a new record in the DB, then you can use the update method to write the information to that record.

           

          Conversely you could srite SQL statements to do the update for you.

           

          Paul

          1 person found this helpful
          • 2. Re: Submit data to MySQL localhost
            Shailevit Level 1

            I think you lost me.

             

            I already created the PDF with all the fields and tied them to the MySQL connections created via ODBC in the binding of each field. So I want now the client to fill the form and hit submit (somehow) and that information should populate their MySQL database locally (localhost, port 3300, TCP/IP). But somehow they I have to create a submit button - right ? For now I want the data to flow in one direction: PDF populates DB.

             

            Did I miss something ? I can also send you the form or screen shot if needed.

             

             

            Cheers

            Shai

            • 3. Re: Submit data to MySQL localhost
              pguerett Level 6

              Wrong .....when you create an ODBC connection there are built in functions that you can take advantage of

              when dealing with the DB. Being able to move between records, inserting records updating records

              things like that. To get access to them all of the commands follow the structure:

               

              xfa.sourceSet.DataConnectionName.function.....

               

              I have included a sample program that shows these functions on buttons in the form. It will not work for you as you do not have access to the DB but the code on the buttons is what you want to play with.

               

              Note I am doing a tech talk on forms talking to databases today at 12 EST. Here is the link to the registration if you are interested in attending:

               

              http://acrobatusers.com/events/2220/tech-talk-database-connected-forms

               

              Paul

              1 person found this helpful
              • 4. Re: Submit data to MySQL localhost
                Shailevit Level 1

                Thanks Paul - excellent webinar (sorry I missed it, but I saw the saved version). I did have a question though you did not cover during your talk but only briefly mentioned. If I have 4 Data connections - since there are multiple fields and each one belongs to their respective table, How do I create ONE button that will update all the fields to the database?

                 

                PS: I did not get attachment of your codes for the buttons, but the webinar covered much of what I needed except the one button solution.

                 

                Also I have attached the form I am referencing so you can get a feel for what I am trying to do.

                 

                Thanks again for your help and advice.

                Cheers

                Shai

                • 5. Re: Submit data to MySQL localhost
                  pguerett Level 6

                  Your attachment did not come through. You can only attach through the UI on the forum, it will not pick up attachments in the email.

                   

                  You would have to right commands to affect each different data connection that you want to control. So you may have 4 commands on the button, each one updating a different database. Remeber the format indicates which dataconnection name you are dealing with:

                   

                  xfa.sourceSet.dataconnectionName.operation()

                   

                  Hope that helps

                   

                  Paul