Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Populate field from SQL table

Avatar

Level 1

Hi Hoping someone can help. I want to populate a form from a SQL table. The idea I have is to enter a membership number into a text field and then the matching details are pulled from a SQL table & populate the form i.e. name, DOB, address. There are about 10000 records in the SQL table. Any ideas or help appricated. There is an example provided in the HELP section (see below) but it does not work

//Change the commandType from TABLE to TEXT. TEXT //is the equivalent of SQL Property $sourceSet.DataConnection.#command.query.commandType = "text"  //Set the Select Node. Select in this case will be  //whatever SQL Property you want $sourceSet.DataConnection.#command.query.select.nodes.item(0).value = Concat("Select*from OfficeSupplies Where ID = ", DataListBox1.rawValue,"")  //Reopen the Data connection $sourceSet.DataConnection.open()

2 Replies

Avatar

Level 1

I should have said that I made a connection to the table using an ODBC connec

tion


Avatar

Former Community Member

There is a blog entry from Stefan Cameron that describes this and has examples. Here is the basic one:

http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/

And here is the more advanced get a specific record one:

http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/

I also did a webinar on this topic .....here is a link to that webinar.

http://adobechats.adobe.acrobat.com/p69655795/?launcher=false&fcsContent=true&pbMode=normal

Paul