Results 1 to 5 of 5

Thread: Adding QODBC support on ubuntu.

  1. #1
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Adding QODBC support on ubuntu.

    Hello, ODBC is not build in the Ubuntu/Debian packages and there are no .debs available for it. I reported a bug here:

    https://bugs.launchpad.net/ubuntu/+s...11/+bug/179261

    Now i'm trying to get the plugin to work.

    I followed this instruction to build a QODBC plugin called 'libqsqlodbc.so'. Only difference is that the plugin is built with qt-x11-opensource-src-4.3.3 and Ubuntu installs 4.3.2.

    I can load the driver dynamicly using QSqlDriverPlugin and QSqlDatabase::addDatabase(driver, "QODBC" ).

    But is this the only thing you can do with a plugin? Load it dynamically from code? Or is it possoble Qt will load the plugin itself when it needs it without loading it from code.

    I tried just putting it in /usr/share/qt4/plugins/sqldrivers/ but its not automatically seen then.

    I'm a bit confused about it.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding QODBC support on ubuntu.

    Quote Originally Posted by Peter_V View Post
    I tried just putting it in /usr/share/qt4/plugins/sqldrivers/ but its not automatically seen then.
    Qt won't load a plugin built for a newer version.

  3. #3
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding QODBC support on ubuntu.

    Well I found the correct version qt-x11-opensource-src-4.3.2.tar.gz, compiled the odbc driver and added it to '/usr/share/qt4/plugins/sqldrivers/', but its still not seen.

    A test program sais:

    QSqlDatabase: QODBC driver not loaded
    QSqlDatabase: available drivers: QPSQL7 QPSQL QMYSQL3 QMYSQL QSQLITE QSQLITE2


    test program is just one line:
    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC" );

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding QODBC support on ubuntu.

    Quote Originally Posted by Peter_V View Post
    test program is just one line:
    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC" );
    You have to create QApplication or QCoreApplication instance before you can use any plugins.

  5. The following user says thank you to jacek for this useful post:

    Peter_V (30th December 2007)

  6. #5
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding QODBC support on ubuntu.

    Quote Originally Posted by jacek View Post
    You have to create QApplication or QCoreApplication instance before you can use any plugins.
    Thanks a lot, that worked

Similar Threads

  1. Problem when adding XML support
    By Shawn in forum Qt Programming
    Replies: 9
    Last Post: 22nd May 2007, 13:27

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.