if(qstr_textLine.count(";",Qt::CaseInsensitive)== 2){
qstr_textLine.prepend("'");
qstr_textLine.append("'");
int sqlbool=insertquery.exec("INSERT INTO testtbl (field1,field2,field3) "
"VALUES ("+qstr_textLine+")");
}
if(qstr_textLine.count(";",Qt::CaseInsensitive)== 2){
qstr_textLine.replace(QString(","), QString("."));
qstr_textLine.replace(QString(";"), QString(","));
qstr_textLine.replace(QString("'"), QString("''"));
QSqlQuery insertquery;
qstr_textLine.replace(QString(","), QString("','"));
qstr_textLine.prepend("'");
qstr_textLine.append("'");
qstr_textLine.replace(QString("'NULL'"), QString("NULL"));
int sqlbool=insertquery.exec("INSERT INTO testtbl (field1,field2,field3) "
"VALUES ("+qstr_textLine+")");
}
To copy to clipboard, switch view to plain text mode
Bookmarks