Results 1 to 14 of 14

Thread: DB Connection Problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Location
    Republic of Korea
    Posts
    1
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default DB Connection Problem

    i had this Problem, DB Connection fail!

    O.S :Windows_XP
    tool :Qt_Program(Ver. 4.3.3) installed on VisualStudio 2005
    DataBase : Oracle 10g

    I want to Connect DataBase , this is my source code

    frist, i added Qt Module(Sql)

    Qt Code:
    1. #include <QtSql>
    2. #include <QSqlDatabase>
    3. #include <QSqlQuery>
    4. #include <QSqlQueryModel>
    5.  
    6. db = QSqlDatabase::addDatabase("QOCI");
    7. db.setHostName("192.168.1.223");
    8. db.setDatabaseName("SSS");
    9. db.setPort(1521);
    10. db.setUserName("kkkk");
    11. db.setPassword("1111");
    12. bool ok = db.open();
    To copy to clipboard, switch view to plain text mode 
    and....... This defined tnsname.ora file
    Qt Code:
    1. SSS =
    2. (DESCRIPTION =
    3. (ADDRESS_LIST =
    4. (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.223)(PORT = 1521))
    5. )
    6. (CONNECT_DATA =
    7. (SERVICE_NAME = SSS)
    8. )
    9. )
    To copy to clipboard, switch view to plain text mode 

    compile Result : No error , but ok's value is false!

    so... what's is the problem?
    Last edited by jpn; 27th June 2008 at 22:46. Reason: missing [code] tags

Similar Threads

  1. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 10:22
  2. connection Problem
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 2nd August 2007, 17:59
  3. [QMYSQL] connection problem
    By chaos_theory in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd July 2007, 09:52
  4. Signal-slots connection problem.
    By impeteperry in forum Qt Tools
    Replies: 26
    Last Post: 23rd January 2007, 14:33
  5. connection problem
    By mhoover in forum Qt Programming
    Replies: 1
    Last Post: 7th July 2006, 22:14

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
  •  
Qt is a trademark of The Qt Company.