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

listbox and ODBC

lucianopilla
Registered: Oct 18 2007
Posts: 76
Answered

hello,
i have the need to populate an acrobat javascript listBox with all the values from one column access table. Actuallt i tried only to import the first value for column. How can i do for improving my script?

Adding intelligence to documents

My Product Information:
Acrobat Pro 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Have you been able to successfully use the ADBC object? There are some restrictions on it in Acrobat 8. Here's the tech note.

http://kb.adobe.com/selfservice/viewContent.do?externalId=333472

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

lucianopilla
Registered: Oct 18 2007
Posts: 76
i've no problem with ADBC, the only problematical is to pass all values of an access table columns into a list_box created by ADM javascript! At the moment my list_box visualize only the first value of column! I thiked about a ketstroke event to visualize the nextRow() in the appropriated field, what do you think about? have you some suggest about?

Adding intelligence to documents

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You didn't say that you were using a custom JavaScript dialog before. To get an answer you need to provide complete information.

So what exactly is the issue you are having?

Are you using "app.execDialog()"? is this what you mean by an ADM JavaScript? If this is the case, then does the list need to be filled before "app.execDialog()" is called, or while the dialog is running?

Do you need to know how to build the structure for setting the list items?

In your post you say that you can only acquire data from the first row. It's easy enough to write a loop to call "nextRow()" to acquire data from all of the rows. So what exactly is the issue here? You also mention using a keystroke event. Custom dialogs do not have a keystroke event.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

lucianopilla
Registered: Oct 18 2007
Posts: 76
ok, sorry for imprecisions.
i'm using the app.execDialog() method in particular i refer to initialize dialog handler. I'd like to "download" all the records of an access table's column into a listbox dialog element. Actually i'm able to obtain only the first record of column. How can i obtain all values in listbox? what's the right way?
Best regards

Adding intelligence to documents

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So your saying that the "statement.nextRow()" and "statement.getRow()" functions aren't returning the next row in the DB? This is odd because if you were able to connect to the DB and get the first record, there should be no problem getting other records.

What code are you using? What SQL query?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, it's possible to insert all records from the db into a dialog list.

Your code looks great. Everything you need is there, and if it all works as is. Then all you need to do to complete it is to write a loop that does "statement.getRow()" until it returns null. Each time through the loop, get the row data, extract your parameter, and add it to your list object (stinit). Do not include "dialog.load" in the loop.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

lucianopilla
Registered: Oct 18 2007
Posts: 76
thanks tomp! after some attempts now it's work!

Adding intelligence to documents