Results 1 to 3 of 3

Thread: ODBC Oracle. Unable to connect to database

  1. #1
    Join Date
    Oct 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question ODBC Oracle. Unable to connect to database

    Using Qt 4.4.3, Mingw, Windows XP, Oracle 9.2

    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    db.setDatabaseName("DataSourceName");
    db.setUserName("username");
    db.setPassword("password");

    db.open gives error message:
    [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed QODBC3: Unable to connect

    When I misspell "DataSourceName", I get the error ..... Data source name not found ....., so that name is obviously working.
    Testing the connection in "Microsoft ODBC Adminstrator" works ok.
    Empty username and password makes no difference.

    Trace file from ODBC Adminstrator attached. (trace.txt)

    (Until now we have used a Delphi program with Borland BDE, but are migrating to Qt4 and C++.)
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2008
    Posts
    69
    Thanks
    9
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ODBC Oracle. Unable to connect to database

    did u include the "sqlodbc.dll" (or similar name) in the qt\4.4\plugins\sqldriver directory?

  3. #3
    Join Date
    Oct 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ODBC Oracle. Unable to connect to database

    Hello

    I built qsqlodbc4.dll and qsqlodbcd4.dll (they are now in ...\plugins\sqldrivers) as described in http://doc.trolltech.com/3.3/sql-driver.html#QODBC3

Similar Threads

  1. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  2. Fun with ODBC and Oracle
    By KaptainKarl in forum Installation and Deployment
    Replies: 4
    Last Post: 27th July 2007, 21:42

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.