Commit 1896782c by guanghui.cui

修复sqlite读取异常

parent 6be36ff2
...@@ -36,7 +36,7 @@ bool FMBackup::connect() ...@@ -36,7 +36,7 @@ bool FMBackup::connect()
if(!QFile::exists(dbname)) { if(!QFile::exists(dbname)) {
isOk = createTable(dbname); isOk = createTable(dbname);
} else { } else {
_db = QSqlDatabase::addDatabase("QSQLITE"); _db = QSqlDatabase::addDatabase("QSQLITE", "fmvipbackupdb");
_db.setDatabaseName(dbname); _db.setDatabaseName(dbname);
isOk =_db.open(); isOk =_db.open();
} }
...@@ -51,7 +51,7 @@ bool FMBackup::connect() ...@@ -51,7 +51,7 @@ bool FMBackup::connect()
bool FMBackup::createTable(const QString &dbname) bool FMBackup::createTable(const QString &dbname)
{ {
_db = QSqlDatabase::addDatabase("QSQLITE"); _db = QSqlDatabase::addDatabase("QSQLITE", "fmvipbackupdb");
_db.setDatabaseName(dbname); _db.setDatabaseName(dbname);
_db.open(); _db.open();
QSqlQuery query(_db); QSqlQuery query(_db);
......
...@@ -15,6 +15,7 @@ FMPVipServer::FMPVipServer() : ...@@ -15,6 +15,7 @@ FMPVipServer::FMPVipServer() :
socket(nullptr), socket(nullptr),
dispatcher(new FMVipDispatcher(this)) dispatcher(new FMVipDispatcher(this))
{ {
FMP_INFO() << "Listen port:23770 ";
Listen(23770); Listen(23770);
connect(this, &QTcpServer::newConnection, this, &FMPVipServer::onNewConnection); connect(this, &QTcpServer::newConnection, this, &FMPVipServer::onNewConnection);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment