C++ (Qt) QString s_query="insert into person (ID, TN, fam, name, otch, birthdate, adr, grazd, sex )" "values (:id, :TN, :fam, :name, :otch, :birthdate, :adr, :grazd, :sex )"; query->prepare(s_query); query->bindValue(":id",number_id); query->bindValue(":TN",tableNumber); query->bindValue(":fam",fam.toLacal8Bit); query->bindValue(":name",name.toLocal8Bit()); query->bindValue(":otch",otch.toLocal8Bit()); query->bindValue(":birthdate",date); query->bindValue(":adr",adr); query->bindValue(":grazd",grazd); query->bindValue(":sex", sex); query->exec();
C++ (Qt) QSqlDatabase db=QSqlDatabase::addDatabase("QODBC","kadrfox"); db.setDatabaseName(QString("DRIVER={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=%1").arg(base_name)); if(!db.open()) { QMessageBox::warning(0,"",db.lastError().text()); return db.lastError().number(); } QSqlQuery *query=new QSqlQuery(db);