Highlighted

Database Connection

Avatar

Guest

13-10-2008

Im new to working with Livecycle. I am attempting to connect to a SQL database. Im able to setup the connection easy enough and select the table i want to query, but when I enter the field in to the binding section and test it. the field only displays the first value. Ive tied it different ways with different types of objects (list box, combo box, ect) .any ideas what Im missing...?

Replies

Highlighted

pguerett

14-10-2008

When you create the connection in the Dataview by default the connection to the dB will happen when the form is loaded. Hence it will return the 1st record. In the data connection definition there is a delayed open checkbox on the last panel. If you check this off then you can control when the data connection happens. I have some samples that show how to get a SQL statement into the connection and cause it to open. If you post your email address I will send it to you.
Highlighted
Highlighted

kc

09-12-2008

Hi again,



I have been fidling a little with "things", but I still haven't found what I am looking for.



I found one of your older posts with this essential content:



-----



1. First lets change the connection to accept a sql command instead of connecting and getting all records:



xfa.sourceSet.DataConnection.nodes.item(1).query.setAttribute("text", "commandType");



2. Now lets set the SQL command we want to execute:



xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value="Select * from Parts Where PART_NO = " + TextField1.rawValue;



3. Now we are ready to open the connection:



xfa.sourceSet.DataConnection.open()



-----



However I can't make it work in Acrobat 9, I get an error telling me the following:



GeneralError: Operation failed.

XFAObject.open:6:XFA:form1[0]:#subform[0]:Button1[1]:click

Connection for Source DataConnection failed because the environment is not trusted.



What can I do to go around this.



Sincerely

Kim
Highlighted
Highlighted

_Anthony_Idigo_

18-12-2008

Hi Paul,



Here is my issue and I hope you can help.

I want to have a submit button on a form, that when clicked by the user can take the data and add it the database table which i made the connection to and of which the fields in the form were based on. Could you help with this or direct me to somewhere I can follow. It would be much appreciated.



Thanks,



Anthony
Highlighted

pguerett

19-12-2008

What type of Database is it? In most cases you will need to do two operations. One is to create the new record in the DB and 2 update the record that was just added using the update() method.