Results 1 to 2 of 2

Thread: problem connecing the db

  1. #1
    Join Date
    Mar 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default problem connecing the db

    Hi,
    i'm trying to connect my ORACLE db, i already compiled the plugin and now i'm trying the following code:

    Qt Code:
    1. #include <QCoreApplication>
    2. #include <QtGui>
    3. #include <QtSql>
    4. #include <QDebug>
    5.  
    6. #include "mainwindow.h"
    7.  
    8. int main(int argc, char *argv[])
    9. {
    10. QCoreApplication myApp(argc, argv);
    11.  
    12. db.addDatabase("QOCI");
    13. db.setHostName("in13");
    14. db.setDatabaseName("RFV75");
    15. db.setUserName("RFVDB19");
    16. db.setPassword("RFVDB19");
    17. db.setPort(1521);
    18. if (db.open())
    19. qDebug("open");
    20.  
    21.  
    22. return myApp.exec();
    To copy to clipboard, switch view to plain text mode 

    but not connecting and no error in the output
    please help

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: problem connecing the db

    What does QSqlDatabase::lastError() say?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.