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