PDA

View Full Version : Deployed Qt program failed to connect to MSSQL Database



bbgunner
25th November 2010, 09:48
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

tbscope
25th November 2010, 09:52
Did you include the correct SQL plugin and install it in the correct folder?

bbgunner
25th November 2010, 09:58
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 !

tbscope
25th November 2010, 10:17
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

bbgunner
25th November 2010, 17:53
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

tbscope
25th November 2010, 17:57
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.

bbgunner
25th November 2010, 21:02
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.