标题:在symbian S60V5打开数据库失败。
作者:9517538624
日期:2011-08-28 22:07
内容:
我的代码是:
bool sql::connectDatabase(const QString& fileName)
{
db=QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(fileName);
if(!db.open())
{
QMessageBox::critical(0,QObject::tr("Database Error"),
db.lastError().text());
return false;
}
return true;
}
然后在我真机:5530上面,打开数据库的时候,显示不能打开数据库:“unbale to open database file Error opening database”
#1 [9517538624 08-28 22:08]
fileName
是从文件读入框里面读入的数据库名字(应该包含了路径了)
#2 [9517538624 08-28 23:11]
好吧~~我又自问自答了要在前面加个
QDir::toNativeSeparators()