I'm trying to connect to my db in Oracle with the following code:
#include "mainwindow.h"
#include <QCoreApplication>
#include <QtGui>
#include <QtSql>
int main(int argc, char **argv)
{
QCoreApplicati开发者_运维知识库on myApp(argc, argv);
QSqlDatabase db;
db.addDatabase("QOCI");
db.setDatabaseName("RFV75");
db.setUserName("RFVDB19");
db.setPassword("RFVB19");
db.setPort(1521);
return myApp.exec();
}
but i get the following error: QSqlDatabase: QOCI driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
i'm using QT 4.6 and QT Creator 2.0 i set the .pro file to:
QT += core gui sql
what's the problem ?
You don't have an Oracle driver compiled into your Qt libraries.
This might help: QOCI for the Oracle Call Interface (OCI)
You probably haven't linked the Oracle driver to your executable.
精彩评论