cancel
Showing results for 
Search instead for 
Did you mean: 

Database connection

former_member413912
Discoverer
0 Kudos

Hi,

i have a questions about database connection in interactive Forms.

I have create an dataconnection OLEDB with ODBC to my sql server 2008 database.

Using LCD 8.1.

My first question is:

Whats the problem when i am become the error message: "Unable to create SOM expression $record.database.fieldname"?

The exprsseion was made from the LCD. Whats the Problem?

I also get the entries of the database in my dropdown-list so i don´t know where the problem is.

The Second question is:

I want to make a select at the database (Dataconnectionname is Test)

$sourceSet.Test.#command.query.commandType = "text"

$sourceSet.Test.#command.query.select.nodes.item(0).value = Concat("Select*from Test Where matnr = ", xfa.event.newText,"")

$sourceSet.Test.open()

if the event starts, i get always a message: Error: Propertie 'commandType' could not be adjusted, because it would breach against the authority adjustment from the document.

Where can i change them?

Thanks for each answer

Accepted Solutions (0)

Answers (1)

Answers (1)

OttoGold
Active Contributor
0 Kudos

Whats the problem when i am become the error message: "Unable to create SOM expression $record.database.fieldname"?

Provided path through the XML tree/ form structure is invalid. How did you get the "path"? How did LCD created for you? Elaborate what have you done and what is the goal, please.

The Second question is:

I want to make a select at the database (Dataconnectionname is Test)

$sourceSet.Test.#command.query.commandType = "text"

$sourceSet.Test.#command.query.select.nodes.item(0).value = Concat("Select*from Test Where matnr = ", xfa.event.newText,"")

$sourceSet.Test.open()

Where did you get the code? Why do you think it works? Can you share your source here? Maybe we could find the error for you. Regards Otto

former_member413912
Discoverer
0 Kudos

Provided path through the XML tree/ form structure is invalid. How did you get the "path"? How did LCD created for you? Elaborate what have you done and what is the goal, please.

This Path cames automatic from the Dataconnection:

bind0 and bind1.

<sourceSet xmlns="http://www.xfa.org/schema/xfa-source-set/2.4/">
   <source db="ado" name="Test">
      <connect delayedOpen="0" timeout="15">
         <connectString>Provider=MSDASQL.1;Persist Security Info=True;User ID=sa;Data Source=SQL_SERVER_2008;Mode=ReadWrite;Initial Catalog=Interactive_Forms</connectString>
         <user>USER</user>
         <password>PASSWORD</password>
      </connect>
      <command timeout="30">
         <query commandType="table">
            <select>Test</select>
            <recordSet bofAction="moveFirst" cursorLocation="client" cursorType="static" eofAction="moveLast" lockType="optimistic"/>
            <map bind="#bind0" from="matnr">
               <?templateDesigner DataType 130?></map>
            <map bind="#bind1" from="meins">
               <?templateDesigner DataType 130?></map>
         </query>
      </command>
      <bind id="bind0" ref="$record.Test.matnr"/>
      <bind id="bind1" ref="$record.Test.meins"/>
   </source>
</sourceSet>

I only want to fill a dropwdown-list from a database table. (works, in spite of the error)

next step should be to select one item of the dropdown-list and get further data from the database.

this should work with the coding beneath.

The Second question is:

I want to make a select at the database (Dataconnectionname is Test)

$sourceSet.Test.#command.query.commandType = "text"

$sourceSet.Test.#command.query.select.nodes.item(0).value = Concat("Select*from Test Where matnr = ", xfa.event.newText,"")

$sourceSet.Test.open()Where did you get the code? Why do you think it works? Can you share your source here? Maybe we could find the error for you. Regards Otto

this code came from the LCD help:

LINK:[Using a button to populate fields from a database|http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/js/html/wwhelp.htm]