我的函数如下:
void CMainWindow::toLog(QString telno, QString content)
   {
   QDateTime cdt=QDateTime::currentDateTime();
   QSqlQuery txbzQuery(txbz);
   txbzQuery.prepare("insert into mt_log(mt_time, telno, content) values"
                         "("
                         ":cdt, :telno, :content"
                         ")");
   txbzQuery.bindValue(":cdt", cdt);
   txbzQuery.bindValue(":telno", telno);
   txbzQuery.bindValue(":content", content);
   txbzQuery.exec();
   }
其中content是中文串,但写在数据库里面用pgAdmin看却是"?"。这是什么原因?
[ 此贴被XChinux在2006-05-24 18:41重新编辑 ]