QTextCodec* codec = QTextCodec::codecForName("CP1251"); QTextCodec::setCodecForTr(codec); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForLocale(codec); setlocale(LC_ALL,"");
QSqlQuery q = db.exec("SET NAMES 'cp1251'");
QTextCodec* qtcCodec = QTextCodec::codecForName("CP1251"); ....qsqQuery->bindValue(":value",qtcCodec->fromUnicode(lineEdit->text()));
....qPerson.exec( "INSERT INTO am_insured_peoples SET " "transport_id='"+qSessionID+"'," "firstname='"+qsFN+"'," "lastname='"+NorE_person.qsLastName+"'," "middlename='"+NorE_person.qsMiddleName+"'," "birthday='"+qsDateBD+"'," "sex='"+QString(NorE_person.nSex)+"'," "experience='"+qsDateExp+"'," "p_series='"+NorE_person.qsPSerie+"'," "p_number='"+NorE_person.qsPNumber+"'," "p_exit_organ='"+NorE_person.qsPWhoExit+"'," "p_exit_date='"+qsDatePExit+"'," "d_series='"+NorE_person.qsDSerie+"'," "d_number='"+NorE_person.qsDNumber+"'," "region_id='"+NorE_person.qsRegionID+"'," "city_id='"+NorE_person.qsCityID+"'," "city_noexist='"+NorE_person.qsCityName+"'," "street='"+NorE_person.qsStreet+"'," "house='"+NorE_person.qsHome+"'," "building='"+NorE_person.qsBuilding+"'," "apart='"+NorE_person.qsApart+"'" );