Dear All,
I am starting to become mad, Designer... Ahhhhhhh!
Ok, I have a great form with a Database connection, this connection has to be used for inserting and recovering data, I mean, once the customer open the pdf it tries to recover the data from the specified table (this works), once the customer modifies the data and close the pdf I attempt to insert the new data into the DB (just an insert! no more I promise)
My problem is, the first select * from... works perfectly:
...
DB.resolveNode("#command").query.commandType = 'text';
DB.resolveNode("#command").query.select.value = 'Select * from T2';
DB.open();
...
But when I try to insert the data (I have to perform several insert sentences) I get an error when I try to open the database. This is my code:
...
DB = xfa.sourceSet.ora1;
record = xfa.record.ora1;
DB.resolveNode("#command").query.commandType = 'text';
DB.resolveNode("#command").query.select.value = 'insert into t2 values (\'hello\',\'hello\')' ;
DB.resolveNode("#command").query.recordSet.setAttribute("stayBOF", "bofAction");
DB.resolveNode("#command").query.recordSet.setAttribute("stayEOF", "eofAction");
DB.open();
...
When the designer tries to open the database an error happen, but amazingly it inserts the data and after that show me this error:
GeneralError: Operation Error.
XFAObject.open:20:XFA:Formulario1[0].#subform[0].Botón1[1]:click
Adobe operation failed. The collection element that belongs to the name or the ordinal requested could not been found
(this is the english translation of the spanish error)
I have created a blank form, and the same error was shown. Also I have executed the insert directly in the database just to be sure and works perfectly.
Does anybody known whats wrong? Why the .open() fail after inserting the row? Does anybody has a simple sample?
Searching in the Forum I have found another way to do it, it is linking the database table fields to fields in the pdf and use the .addnew() method. So I have created the fields, I have linked it and created a button with the addnew() button. I write in the fields and click on the Button.... but nothing happens. Another time, what am I doing wrong here?
Any help will be apreciated, in two days I have to present it to my customers...
Thanks in Advance.
Ruben