Problems when I have tried execute two consecutive selects

Hi,
I am trying to execute two consecutive selects, when the second sql has been executed, it response "Operation failure of ado2xfa. Imposible find the element in the colection that corresponds with the name" (I have translated the message).
The error happens when I execute the second DB.open
In the data conection I have selected "text" in the commandType with "select * from t1"
First I tried to execute both sqls but, if I try to execute just the "select * from t2" in the first sql command I obtain the same error.
In the data view I have just one db connection linked with table T1, do I need to create one db connection per table?
For example if I want to connect with 6 different tables I will need 6 different DB connection objects.
Somebody know what is the problem?
Thanks
Rubén
var DB;
var record;
var i;
DB = xfa.sourceSet.Oracle
record = xfa.record.Oracle
try {
DB.close();
} catch (e) {}
DB.resolveNode("#command").query.select.value = 'Select * from T1';
DB.open();
DB.first();
for (i=0;i <= record.nodes.length;i++)
console.println(record.nodes.item(0).value);
DB.next();
DB.close();
DB.resolveNode("#command").query.select.value = 'Select * from T2';
DB.open(); <--------LINE THAT PRODUCE THE ERROR---------

It's because the data connection has been set up to expect the fields returned from T1. When you query T2 different fields are returned and it doesn't know what to do with them so it throws an error. You would need to 2 data connections, 1 for T1 and 1 for T2.
Chris
Adobe Enterprise Developer Support

Similar Messages

Maybe you are looking for

  • Can't make an AVI file

    I'm trying to create an AVI file for someone, but I just can't seem to get it to work. I currently have it encoded in a MOV wrapper, and when I run it through MPEG Streamclip, it comes out with no audio, or, depending on the settings, QT complains th

  • Hp 620 connection randomly lost,after restart sometimes comes back then goes again

    Randomly wireless connection goes away.And says not connected and no connection available.Wireless button stays always white and doesnt respond . After restart sometimes connection comes but then goes again after 1-2 minute.Network adapter looks like

  • MacBook Pro running Lion constantly spins up external hard drives while sleeping

    My MacBook Pro 8,2 running Lion 10.7.2 constantly spins up its external hard drives (one Firewire 800 and two USB) while sleeping. Is there any way to prevent this? The drives will spin down for a minute or so and then spin back up, which is incredib

  • Pc Suite: File Manager not working

    I can't access file systems on my E50 using PC Suite's file manager, neither via Bluetooth nor via cable.  The message is something like "Can not connect to mobile phone" (Original German message: 'Verbinden zum Telefon nicht möglich'). When I tried

  • XI integration

    Hello every one....           As doing web log scenario..BW-XI integration( how to send XML data to BW from XI ). I configured all the steps in that web log..but final step is not woking eventhough i created html file nad xml file as per the web log