Problem with data base queries .
-
Hi this piece of code was working fine until I changed the database extension(.db instead of .sqlite) the queries don't want to execute anymore even when the data base is connected.
Here is the function where I have the problem..
in this particular function the output result stops in displaying " query is prepared" .
@void home::on_pushButton_2_clicked()
{
QString user_name,password;user_name=ui->lineEdit->text(); password=ui->lineEdit_2->text(); if(!connOpen()){ qDebug()<<"failed to open Data Base "; return; } connOpen(); qDebug()<<("Data base is opened"); QSqlQuery qry; qry.prepare("select * from description_societe where nom='"+user_name+"' and mp='"+password+"' "); qDebug()<<("qry is prepared"); if(qry.exec()){ qDebug()<<("query is executing..."); int count=0; while(qry.next()) { count++; } if(count==1) { ui->label_16->setText("user_name and password are correct"); connClose(); qDebug()<<("connection closed"); loginEntreprise a; this->hide(); a.setModal(true); a.exec(); } if(count>1) { ui->label_16->setText("duplicate user_name or password"); } if(count<1) { ui->label_16->setText("user_name or password are incorrect"); } }
}@
Thanks in advance.