q->prepare("INSERT INTO sianimtable (CIPHER,CIPHERKP,TITLE,MSGON,MSGOFF) VALUES(:le1,:le2,:le3,:le4,:le5);");
q->bindValue(":le1",le1->text());
q->bindValue(":le2",le2->text());
q->bindValue(":le3",le3->text());
q->bindValue(":le4",le4->text());
q->bindValue(":le5",le5->text());
if(q->exec(sqlstr)==false)
{
pmsg->setText("can't connect with db");
pmsg->setInformativeText(q->lastError().text());
pmsg->exec();
}
delete q;
QSqlQuery *q = new QSqlQuery();
q->prepare("INSERT INTO sianimtable (CIPHER,CIPHERKP,TITLE,MSGON,MSGOFF) VALUES(:le1,:le2,:le3,:le4,:le5);");
q->bindValue(":le1",le1->text());
q->bindValue(":le2",le2->text());
q->bindValue(":le3",le3->text());
q->bindValue(":le4",le4->text());
q->bindValue(":le5",le5->text());
if(q->exec(sqlstr)==false)
{
QMessageBox *pmsg = new QMessageBox;
pmsg->setText("can't connect with db");
pmsg->setInformativeText(q->lastError().text());
pmsg->exec();
}
delete q;
To copy to clipboard, switch view to plain text mode
Bookmarks