Results 1 to 3 of 3

Thread: Qt ODBC data source not found

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Qt ODBC data source not found

    Hello all,
    Currently i am working on a project in which i have to connect MySQL database through ODBC.
    Operating system : CentOS

    the problem i am facing is, whenever i execute the aplication it says

    [unixODBC][Driver Manager]Data source name not found, and no default driver specified QODBC3: Unable to connect

    Qt Code:
    1. database_manager_ = QSqlDatabase::addDatabase("QODBC3", "test_qt");
    2. database_manager_.setDatabaseName("Server=localhost;Database=test_qt;user=karan;password=karan;");
    3. database_manager_.setHostName("localhost");
    4. database_manager_.setUserName("karan");
    5. database_manager_.setPassword("karan");
    To copy to clipboard, switch view to plain text mode 

    searched a lot on google but not found any successfull solution.
    Please help..

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt ODBC data source not found

    On Linux you should use the MySql plugin not ODBC.

    If you must use ODBC for some odd reason then you need to provide a valid ODBC DSN in the call to setDatabaseName(), which is the error message you are getting. You define a DSN using the tools provided with unixODBC. Of course you also need a suitable MySQL ODBDC driver.
    Last edited by ChrisW67; 29th June 2013 at 08:47.

  3. The following user says thank you to ChrisW67 for this useful post:

    karankumar1609 (1st July 2013)

Similar Threads

  1. Replies: 1
    Last Post: 20th March 2013, 18:25
  2. source code for odbc driver or MySql driver in arm-embedded-linux
    By sattu in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 24th January 2011, 10:11
  3. Empty SQL Data from ODBC/FreeTDS
    By dentharg in forum Qt Programming
    Replies: 0
    Last Post: 9th November 2009, 07:50
  4. remote ODBC data source
    By mchara in forum Qt Programming
    Replies: 7
    Last Post: 10th December 2007, 10:39
  5. Connecting to an ODBC Data Source
    By kikapu in forum Newbie
    Replies: 9
    Last Post: 25th June 2007, 12:18

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.