Marvelous.
SOLVED:
My problem was that I wasn't using the correct version and/or I had a version mismatch.
I deleted my entire c:\Oracle and started fresh.
I followed The Oracle God, Mark Williams, tutorial here.
I did exactly what he stated, using the older version 11.1.0.6.0
- Download Oracle Instant Client BASIC x32 11.1.0.6.0
- Download Oracle Instant Client SDK x32 11.1.0.6.0
- Download Oracle C++ Call Interface Visual C++ 9 (VS 2008) x32
I built his sample code to make sure everything was right. Once I was able to build successfully then I went to Qt.
Visual Studio Command Line
cd c:\Qt\4.6.2\src\plugins\sqldrivers\oci
set include=%include%c:\Oracle\sdk\include;
set lib=%lib%c:\Oracle\sdk\lib\msvc\vc9;
set path=%path%c:\Oracle\vc9; <--directory you will create from Mark Williams instructions posted above.
set path=%path%c:\Oracle;
qmake oci.pro
nmake
Error Free!!
Created sample Qt app to test.
#include "oci_test_app.h"
#include <QtGui/QApplication>
#include <QSqlDatabase>
#include <QSqlError>
#include <QMessageBox>
bool createConnection()
{
db.setHostName("test");
db.setDatabaseName("test");
db.setUserName("test");
db.setPassword("test");
if(!db.open())
{
return false;
}
}
int main(int argc, char *argv[])
{
if(!createConnection())
return 1;
OCI_TEST_APP w;
w.show();
return a.exec();
}
#include "oci_test_app.h"
#include <QtGui/QApplication>
#include <QSqlDatabase>
#include <QSqlError>
#include <QMessageBox>
bool createConnection()
{
QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");
db.setHostName("test");
db.setDatabaseName("test");
db.setUserName("test");
db.setPassword("test");
if(!db.open())
{
QMessageBox::critical(0, QObject::tr("Database Error"), db.lastError().text());
return false;
}
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
if(!createConnection())
return 1;
OCI_TEST_APP w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
No errors on build. Error free compilation.
Got the Oracle Error Message on run. <-- GOOD
Now we are set to go.
-Blando
Bookmarks