Expand my Community achievements bar.

SOLVED

Submit data to MySQL localhost

Avatar

Level 3

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 Accepted Solution

Avatar

Correct answer by
Former Community Member

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

View solution in original post

5 Replies

Avatar

Former Community Member

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

Avatar

Level 3

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

Avatar

Former Community Member

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

Avatar

Level 3

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

Avatar

Correct answer by
Former Community Member

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

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----