Hello,
So, I have this form that I am trying to get the data submitted to a SQL Database. I have the ODBC connection created and named EmpSep. I have the code written in my form. I keep getting this error:
page1.Subform1 has no properties
2:XFA:form1[0]:page1[0]:Button2[0]:docReady
GeneralError: Operation failed.
XFAObject.setAttribute:3:XFA:form1[0]:page1[0]:Button2[0]:click
This operation violates your permissions configuration.
I have been added to that Table with full access. I am not even getting the warning box that shows me I am submitting something to the Database. Here is my "Button's" click event...
xfa.sourceSet.DataConnection.nodes.item(1).query.setAttribute("text", "commandType");
xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value = "INSERT INTO problems(description)VALUES('"+AllFields.rawValue+"')"
app.alert(xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value);
//now connect to DB and get a record
xfa.sourceSet.DataConnection.open();
Does anyone have any suggestions or see something that I am overlooking?
Thanks,
Brad
The first thing you need to do is validate that you can connect to the DB and read data out of it. If this works out successfully. Then use the "addNew()" function to insert data into the DB. If this works then you can start working on the real form. If you want the SourceSet structure to perform different operations than what is setup from the DataView tab. Then you'll need to modify the SourceSet XML directly. But be careful. you'll need to know exactly what you are doing.
Take a look at Stefan Cameron's blog, http://forms.stefcameron.com/, he knows more about this stuff than anyone. He has a few blog entries on DB connections.
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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script