Hey ya'll! I'm new and in need of guidance. I cannot seem to find help throught the forum on the error I keep getting. I just want to connect to my database. I'm using windows xp professional operating system btw.
So here is my code in main.cpp for connecting to the database with a little popup that will tell me if the connection works. And I've attached the qsql_oci.h and qsql_oci.cpp files.
#include <QtGui/QApplication>
#include <QtSql>
#include <QDebug>
#include <QSqlDatabase>
#include "iostream"
#include "qsql_oci.h"
#include "qsql_oci.cpp"
int main(int argc, char *argv[])
{
db.setHostName("datawarehouse");
db.setDatabaseName("mydatabase");
db.setUserName("hollyberry");
db.setPassword("password");
if(db.open())
{
qDebug() << "Opened!";
db.close();
}
else
{
qDebug() << "Error = " << db.lastError().text();
}
return a.exec();
}
#include <QtGui/QApplication>
#include <QtSql>
#include <QDebug>
#include <QSqlDatabase>
#include "iostream"
#include "qsql_oci.h"
#include "qsql_oci.cpp"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSqlDatabase db = QSqlDatabase::addDatabase("OCI");
db.setHostName("datawarehouse");
db.setDatabaseName("mydatabase");
db.setUserName("hollyberry");
db.setPassword("password");
if(db.open())
{
qDebug() << "Opened!";
db.close();
}
else
{
qDebug() << "Error = " << db.lastError().text();
}
return a.exec();
}
To copy to clipboard, switch view to plain text mode
The first error I continue to recieve is "OCIStmt was not declared in this scope".
Followed by "ub1 does not name a type" and many more errors like this! Grrrr....
Bookmarks