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

PDF Form (LiveCycle) Local Database OK, Network Drive - Not OK

AlScott
Registered: Nov 2 2007
Posts: 123

I've created a project which works perfect when run on the PC where it was created. It's using an Access database, and the PDF file is populated from the MDB file.
There are 3 tables in the database. The PDF file is set regarding the User's access rights, so all is good there.

Now what I don't understand, not for want of trying:
The form has a drop-down menu from where the Product Number is chosen, for example B123,B124,B125, etc...
When the item is found the user clicks on a button called 'Review' and here's where the problem occurs. I get the error box, but it just says "Script Failed...". but no other clue to the problem.
But, why should the drop-down menu work perfectly, but when we come to accessing the remainder of the record up comes the problem.

I've run the same exercise on some of the tutorial databases and I hit the same error.
The User machines are using Acrobat Reader (Standard) - is this the source of the problem?? Everything will be done via a shared drive - ie not via a server.
Help!!!!!!
thanks
Al

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Database access is restricted on Adobe Reader. So this is definately a problem. I don't know about Standard.

However, if you are getting some DB access then you should get everything. There's no halfway when it comes to reading a DB. Are you sure that the Drop-Down is actually doing a DB access? Is the first access when the item is selected, when the first error occurs? If not, and you are getting a access at one point and not at another then it's possible that there is a coding problem.

The way to debug this is to use the console window to find out at what point the code the failure is happening by using "console.println()" statements. See this article:
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

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

AlScott
Registered: Nov 2 2007
Posts: 123
Hi Thomp. I'll have a look at this utility tonight!
Anyway - yes I agree the with the point it seems to be at a 'half-way-point' ie the fact that it's coming up with the numbers. So we have what is the Access ID field, and this field is linked to the game number field in Livecycle, and all works well there. I've kept the ID field but hidden it.
Now if I mess around with this link, eg it's being run off a different terminal you can only see one record, trying to scroll to another one - and up comes the error. So it is reading the database in some fashion.....
If I'm still at a loss may I send you a copy? I appreciate you're swamped with requests, so I might just pop a copy of the java onto a message.
Thanks again,
AlPS - Nope - you're right, the drop-down doesn't work. There must be a way around this. I've shared the drive, then - on the local PC (where the project is) - and then mapped it to that PC and all works perfectly - now I suspect that's due to AB pro (as Livecycle is on that PC too), being effectively installed??
There's no way they'll go for multiple AB Pro licences..............
Al
AlScott
Registered: Nov 2 2007
Posts: 123
Thomp - yes I'm still getting a 'drop-down' with the record numbers - not their 'related' field, ie the game number.
The error I'm getting is:
GeneralError: Operation failed.
XFAObject.open:23:XFA:form1[0]:#subform[0]:BALLYGAMES[0]:SelectField[0]:initialize
connect operation failed. [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specifiedGeneralError: Operation failed.
XFAObject.open:23:XFA:form1[0]:#subform[0]:SelectField[0]:initialize
connect operation failed. [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specifiedGeneralError: Operation failed.
XFAObject.open:23:XFA:form1[0]:#subform[0]:SelectField[1]:initialize
connect operation failed. [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Obviously the form can't connect to the DB. This should mean that it's not working at all. It's not good that the DataSource name is not found, is the drop down code setup properly? There are two parameters at the top of the initialization code that need to be changed before it will work.

Here are some other things you can look at for general DB access.

If you look in the XML for the form you'll see the structure that's created by setting up a data source in the "Data View" tab. It should be at the bottom of the XML in a tag labeled "SourceSet". This is where all the DB access parameters are setup, you can actually modify them here. If you move the form between systems, then these parameters may have to be changed. You can actually do this at runtime with JavaScript. However I couldn't tell you exactly how to do it. Everything depends on your setup. There's also another dependancy. DB access from an LC form depends on the OLE driver specifed in the "SourcSet" info. If that driver is not availible on the system the form is on, then all bets are off. Also, a particular driver might work on a local DB, but choke on a remote one. You have to know that the capabilities of the driver match your use case.

But the first thing is that the connection string is appropiate for system the form is being used from. The way to check this all out is to simplify the access. Setup a form with just one field. Don't even write any code. Just use the field binding to map it to a DB field. Then see how that works when the form is moved around. If it works then everything else should as well. If it doesn't, then you need to figure out what needs to be changed when it's used from another system.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

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