Results 1 to 7 of 7

Thread: Deployed Qt program failed to connect to MSSQL Database

  1. #1
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Deployed Qt program failed to connect to MSSQL Database

    Hi all,

    I am trying to deploy an .exe file that will allow me to access MSSQL database with a computer that doesn't have Qt installed, however I can't connect to to database for some reason.

    It is a release built, and I have included the necessary .dll files (core4.dll, gui4.dll, etc...) but still no luck. I checked dependency walker to make sure I have all the necessary .dll already.
    Please help.

    Regards,
    Jeff

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Deployed Qt program failed to connect to MSSQL Database

    Did you include the correct SQL plugin and install it in the correct folder?

  3. #3
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deployed Qt program failed to connect to MSSQL Database

    Can you please elaborate as I am a newbie to Qt.
    I do not have Qt installed on the computer which I want to run the executable but I do have MSSQL studio installed and it is able to access the database.
    Thanks !

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Deployed Qt program failed to connect to MSSQL Database

    I assume MSSQL means that you use the QODBC driver.

    Qt contains plugins to communicate with the database. The are called sql drivers. You should at least install the driver for the database you use in your program.
    http://doc.qt.nokia.com/4.7/plugins-howto.html
    http://doc.qt.nokia.com/4.7/sql-driver.html

  5. #5
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deployed Qt program failed to connect to MSSQL Database

    Quote Originally Posted by tbscope View Post
    I assume MSSQL means that you use the QODBC driver.

    Qt contains plugins to communicate with the database. The are called sql drivers. You should at least install the driver for the database you use in your program.
    http://doc.qt.nokia.com/4.7/plugins-howto.html
    http://doc.qt.nokia.com/4.7/sql-driver.html
    Hi Thanks for the reply.

    For the computer that is running Qt and deploying the exe, I already have QODBC driver plugin built. The program works perfectly fine and is able to connect to the database. However, for the computer that doesn't have Qt installed, it no longer works.
    Thanks

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Deployed Qt program failed to connect to MSSQL Database

    Last try:

    Did you install the driver also on the computer that doesn't have Qt installed?
    If not, do so! And place it in the correct folder.

  7. The following user says thank you to tbscope for this useful post:

    bbgunner (26th November 2010)

  8. #7
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deployed Qt program failed to connect to MSSQL Database

    Quote Originally Posted by tbscope View Post
    Last try:

    Did you install the driver also on the computer that doesn't have Qt installed?
    If not, do so! And place it in the correct folder.
    Thanks a lot!
    Turns out I wasn't placing the driver in the correct folder.
    BTW is there a way to do it so that when you build the .exe, it includes the necessary .dlls.

Similar Threads

  1. Questions about connect to remote database
    By stmk in forum Qt Programming
    Replies: 3
    Last Post: 11th November 2010, 10:02
  2. QSqlDatabase - How to connect to multiple database?
    By cutie.monkey in forum Qt Programming
    Replies: 4
    Last Post: 10th March 2010, 12:03
  3. Release program failed to show jpg image on another PC!
    By bangqianchen in forum Qt Programming
    Replies: 4
    Last Post: 31st January 2010, 22:16
  4. Replies: 5
    Last Post: 28th August 2006, 14:36
  5. My application can't connect to database when deploy it???
    By gtthang in forum Installation and Deployment
    Replies: 1
    Last Post: 15th February 2006, 11:01

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.