Results 1 to 4 of 4

Thread: Regarding MYSQL connection

  1. #1
    Join Date
    Aug 2008
    Posts
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Regarding MYSQL connection

    Hi ,
    I am using qt-win-commercial-4.4.3-vs2005 and integrated to MSVS2005 using qt-vsintegration-1.3.3 on windows. Now if I use to connect the sqlite database connection its working well.But if I use to connect the MYSQL connection its showing driver not loaded.I looked at" C:\Qt\4.4.3\plugins\sqldrivers" all the dll's are there.So now to make a MYSQL connection shall I have plugin it or what all I have to do for the package I am using.I also installed Mysql(MySQL Server 5.0)
    please suggest me to get out of this problem.

    The code I used to connect is shown below.
    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase( "QMYSQL" );
    2. db.setDatabaseName( "data" );
    3. if ( !db.open())
    4. {
    5. QMessageBox::information(0,"","Failed to open database:"+ db.lastError().driverText());
    6. qWarning( "Failed to open database: " + db.lastError().driverText() );
    7. qWarning( db.lastError().databaseText() );
    8. return 1;
    9. }
    To copy to clipboard, switch view to plain text mode 

    Regards,
    Sudheer.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Regarding MYSQL connection

    Check that dependencies for the mysql driver are met (i.e. using Dependency Walker).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2008
    Posts
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Regarding MYSQL connection

    Hi,
    thanks for your quick reply. I am sorry to say that I can't understand what you have suggested to me .I request you to tell little bit clearly. To make coomunicate with MYSQl through Qt code what all I have to do according to my Package.

    So please help me to get out of this problem

    Regards,
    Sudheer.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Regarding MYSQL connection

    STFW for "dependency walker".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. MySQL and shared-memory connection
    By patrikd in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2008, 16:53
  2. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 10:22
  3. Replies: 3
    Last Post: 2nd August 2007, 21:28
  4. connection could not be establieshed b/w qt and mysql
    By amit_pansuria in forum Installation and Deployment
    Replies: 9
    Last Post: 21st November 2006, 13:24
  5. Qt and MySQL Database Connection
    By shamik in forum Qt Programming
    Replies: 41
    Last Post: 6th October 2006, 12:48

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.