int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
QStringList driver = QSqlDatabase::drivers();
QComboBox *combox = new QComboBox(this);
combox->addItems(driver);
QSqlDatabase database = QSqlDatabase::addDatabase("QSQLITE");
database.setDatabaseName(tr(":memory:"));
if(!database.open())
{
QMessageBox::critical(0, "Error", "Can not open database");
}
creatTable();
}
我这样连接数据库一直都连不上,一直弹出Can not open database,且combox 中也是空的
我在我的Qt安装目录下找到有那些驱动C:\qt\4.3-msvc2005\src\plugins\sqldrivers
请问,QT连接sqlite是怎么连接的
请大侠帮忙
谢谢!!