开发者

qt + oracle connecting problem

开发者 https://www.devze.com 2023-01-15 02:24 出处:网络
I\'m trying to connect to my db in Oracle with the following code: #include \"mainwindow.h\" #include <QCoreApplication>

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消