PDA

View Full Version : problem connecing the db



kaycee1
12th September 2010, 14:13
Hi,
i'm trying to connect my ORACLE db, i already compiled the plugin and now i'm trying the following code:


#include <QCoreApplication>
#include <QtGui>
#include <QtSql>
#include <QDebug>

#include "mainwindow.h"

int main(int argc, char *argv[])
{
QCoreApplication myApp(argc, argv);

QSqlDatabase db;
db.addDatabase("QOCI");
db.setHostName("in13");
db.setDatabaseName("RFV75");
db.setUserName("RFVDB19");
db.setPassword("RFVDB19");
db.setPort(1521);
if (db.open())
qDebug("open");


return myApp.exec();

but not connecting and no error in the output
please help

Lykurg
12th September 2010, 15:15
What does QSqlDatabase::lastError() say?