Results 1 to 3 of 3

Thread: QODBC driver

  1. #1
    Join Date
    May 2009
    Posts
    14
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default QODBC driver

    Hi everyone,

    i have done a qt application who has to connect to another computer who has a Microsoft SQL Server Express Edition.

    I have written this code:

    bool DAO::connect(){
    bool result=true;
    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    db.setHostName("10.2.9.15");
    db.setDatabaseName("Test Bench (Prueba)");
    db.setUserName("admin");
    db.setPassword("admin");
    result = db.open();
    return result;
    }

    An i have created a new ODBC user dns with SQL Server Controller
    I am using Visual Studio 2008, SQL Server Express Edition 2005, Windows Vista and qt4.4.3.

    And when i execute my aplication this errors appears:

    QSqlDatabase: QODBC driver not loaded
    QSqlDatabase: available drivers: QSQLITE

    In the directory C:\qt\4.4.3\qt-win-opensource-src-4.4.3\src\plugins\sqldrivers\odbc i have:

    main.cpp
    odbc.pro
    qsql_odbc.cpp
    qsql_odbc.h
    qsqlodbc_resource.rc
    qsqlodbcd_resource.rc

    I have compiled qmake odbc.pro and the same error again.

    I don´t know what i have to do, if i have to download ODBC driver please tell me where can i download it, because i haven´t found nothing.

    Please help me.

    Thank you very much.

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QODBC driver

    You need to compile odbc plugin as described in Qt Assistant.
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Apr 2010
    Location
    United States
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QODBC driver

    After compiling the odbc plugin be sure to copy libqsqlobdc.so (or .dll on windows) to your qtsdk/bin/sqldrivers/ and qtsdk/qt/plugins/sqldrivers directories so QT can find it and use it.

Similar Threads

  1. MySQL driver , I have, it still not loaded
    By bigkoma in forum Qt Programming
    Replies: 14
    Last Post: 30th January 2011, 10:38
  2. How do I get Qt to recognize the oci driver.
    By yleesun in forum Qt Programming
    Replies: 11
    Last Post: 19th January 2009, 03:50
  3. QODBC Driver
    By mchara in forum Qt Programming
    Replies: 2
    Last Post: 17th January 2008, 14:40
  4. regarding a touch screen driver for qt-embedded
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd March 2007, 10:23
  5. qodbc driver not loaded error in release mode
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2006, 09: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.