I've got the follow problem with this query:

Qt Code:
  1. QSqlQuery *cola2 = new QSqlQuery( "INSERT INTO preguntas ( pregunta, dificultad, referencia, respuesta ) VALUES ( ?, ?, ?, ? )" );
  2. cola2->bindValue( 0, c->texto );
  3. cola2->bindValue( 1, c->dificultad );
  4. cola2->bindValue( 2, c->referencia );
  5. cola2->bindValue( 3, c->respuesta );
  6. if( !cola2->exec() )
  7. {
  8. cout<<"agregar_pregunta()::Error al ejecutar la cola de insercion "<<endl;
  9. cout<<"agregar_pregunta()::Descripcion del error: "<<cola2->lastError().text()<<endl;
  10. TElog->append( "No se pudo agregar la pregunta a la db" );
  11. }
  12. else
  13. {
  14. cout<<"agregar_pregunta()::Registro Agregado"<<endl;
  15. agregadas++;
  16. }
  17. delete(cola2);
To copy to clipboard, switch view to plain text mode 

this query is ona cycle for each record that must be inserted... but at doing a export of the table gets one empty record and a good record..
chequed that this query is executed only once in each record insertion.
Thanks in advance...