lundi 22 décembre 2014

QT QSqlError("", "", "")

Hi I am programming a Stock Control Program in QT but when im inserting data I receive an error of QSqlError("", "", ""), the problem is that the data is being inserted into the database but im unsure that that error means. The code that im using to insert data into the database is below.


query_Account.prepare("INSERT INTO Customer(Company_Name, City, Phone_Number, Street_Adress, County, BULSTAT, Company_Owner, Account_Since) " "VALUES (:Company_Name, :City, :Phone_Number, :Street_Adress, :County, :BULSTAT, :Company_Owner, :Account_Since)"); query_Account.bindValue(":Company_Name", ui->lineEdit_Company_Name->text()); query_Account.bindValue(":City", ui->lineEdit_City->text()); query_Account.bindValue(":Phone_Number", (ui->lineEdit_Phone_Num->text()).toInt()); query_Account.bindValue(":Street_Adress", ui->lineEdit_Street_Add->text()); query_Account.bindValue(":County", ui->lineEdit_County->text()); query_Account.bindValue(":BULSTAT", (ui->lineEdit_BULSTAT->text()).toInt()); query_Account.bindValue(":Company_Owner", ui->lineEdit_Company_Owner->text()); query_Account.bindValue(":Account_Since", 1776-07-04); query_Account.exec(); qDebug() << "SQL query_Account:" << query_Account.executedQuery(); qDebug() << "SQL ERROR:" << query_Account.lastError();


Thanks


Aucun commentaire:

Enregistrer un commentaire