Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Adding form values to SQL Database Table

Avatar

Level 1

Good Evening,

I am creating a local form in LiveCycle and I want users to be able to fill out the form and click a button, which will save the field values to a SQL Database table.

  • I am using LiveCycle Designer ES2 (version 9.0.0.2) to create the form.
  • The created form will be used locally (not web-based) on users desktops running Acrobat X Pro (version 10.0.0)
  • The Database is being hosted on SQL Server 2008
  • The Database connection information is:
    • Connection Properties:
      ConnectionProperties.png
    • OLEDB Connection:

               OLEDB Connection.png

      • Provider=MSDASQL.1;Persist Security Info=False;Data Source=OperationsFX;Extended Properties="DSN=OperationsFX;UID=someuser;Trusted_Connection=Yes;APP=Adobe LiveCycle Designer;WSID=WS01;DATABASE=OperationsFX;"

    • ADO Properties:

               ADOProperties.png         

I have done the below so far:

1. Created the SQL Database, table and columns within it. I have one column which auto-increments as the record id set as a primary key.

2. Created a data connection within my LiveCycle form and binded the specific fields to it.

3. Created a button and within the "click" event, I have the below code:

xfa.sourceSet.DataConnection.addNew();

So with the above done, I then fill in the fields and click the button. Results of what happen are below:

1. The values in my fields clear out.

2. The table within the SQL Database does not add the new record with what was inputted on the form.

So I was thinking maybe for whatever reason the data was never hitting the table. So I:

1. Created one record within the database table manually, inputting the necessary values.

2. Modified the form button within the "click" event with the below code:

xfa.sourceSet.DataConnection.update();

When I opened the form the below happened:

1. My specific fields were populated with the values from the SQL Database table upon opening the form.

2. I modified the fields with different values.

3. I clicked the button with the code to "update" the record and noticed that:

     a. The new values in my form fields cleared out.

     b. The new values were saved to my SQL database table.

So I figure I must be doing something wrong with my code to add new records to the database table.

What I would like to accomplish is:

1. When user opens the form, the form is blank.

2. When user inputs all values in to the specific fields and clicks the button, that the values in the fields remain on the form and are not cleared out.

3. The values that the user inputted on the form are created in the SQL Database table.

Kindly advise how I can accomplish this.

Regards,

K

1 Reply

Avatar

Level 1

Hi,

In my PDF form, I have a drop-down list and it will get the values from SQL Server.  I 'm a beginner for this tool. Please advise me, how to do this.

And one more question " whether the form accessing user need to install the DB in their system?".

Please share your thought urgently !!.