These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Data Connection to Access Database only retrieves first record

JTBob
Registered: Jun 30 2010
Posts: 7

Hi,

I've started working with LiveCycle Designer ES 8.2 and I'm trying to make a simple connection to an Access database and step through the records.

I created the database with an ID primary key, First Name, Last Name and Description fields. And then I filled in 4 entries of names and descriptions.

I set up the ODBC data source to point to that database under Administrative Tools.

In LCD, I set up the data connection, selected the only table, tested the connection and finished. Then dragged the dataconnection items onto the page to create the objects.

Then I dropped a button on the page, called it next and added the following to the click event:
xfa.sourceSet.DataConnection.next();

So when I preview the page, the boxes show the first entry in the database just fine. But when I click on the button, nothing ever changes in the boxes and still continues to show just the first record.

Is there something I need to set in LCD or the Access database to get this call to step through the database records?

Thanks,
Robert

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Check out this tutorial, especially the part with the OLEDB Connection settings with the SQL query.

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

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

JTBob
Registered: Jun 30 2010
Posts: 7
Hi Radzmar,

I did everything in that tutorial and got the same results. I get the first record in the database displayed in the text boxes, but clicking on the buttons for next, last, previous and so on do nothing.

I have four records, so I should be able to go to the next record as least. It's almost like the connection to the database is closed immediately after the first record is retrieved when it opens.

I can't think of what else to try to get this to work.

Thanks,
Robert
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Did you specify the column with the primary key in your SQL query?
If so, remove it from the connection setup.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

JTBob
Registered: Jun 30 2010
Posts: 7
No, initially when I made the data connection, I just selected the table from the drop-down list instead of the SQL query. Then from the Data View window, I dragged it onto the page to bind the buttons with the database fields. When I go to Preview PDF, it shows the first record and the command xfa.sourceSet.DataConnection.next(); does nothing. It just keeps showing the first record.

This time I tried using the SQL query and I select the other fields except the primary key. The Preview PDF shows the first record, but the next command still fails to do anything. Previous, next, addNew, Update all do nothing.

It's really bizarre, since I've seen video tutorials doing the same thing and it works. I try it and I just see the first record and nothing else.

Thanks for you help,
Robert
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
[color=#333333]Do a test in Acrobat with the saved form instead of the preview, because some functions do not work proper in the preview.[/color]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

shawn_loc
Registered: Mar 30 2009
Posts: 11
I've been having a similar problem. I can get the navigational buttons to work fine but the problem comes when trying to find a specific record.

I watched the following tutorial

http://adobechats.adobe.acrobat.com/p69655795/

but after the search dialogue and warning messages pop-up, my fields remain blank.

any ideas?