[Solved]Need to install any supporting software to execute the .exe file from other systems?



  • Hi everyone, I Developed an application and generated its .exe file and added the necessary dlls to it.
    Basically that application gets the data from other system(Windows7, SqlServer and Qt) which is in Lan.

    When I am executing the .exe file on other system(Windows7 SqlServer) which is having Qt, is executing without a problem.

    And if I try to execute the same file from other system(Windows7 no SqlServer and no Qt), the application is getting failed to retrieve the data from database.(.exe file is executing)

    If I try to execute the same file from other system(Windows Xp having SqlServer and Qt), the application is getting failed to retrieve the data from database.(.exe file is executing)

    All systems are connected in Lan. I give a connection string as follows.

    @QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    db.setHostName("CONS04-PC\SQLEXPRESS");
    db.setDatabaseName("DRIVER={SQL Server};SERVER=CONS04-PC\SQLEXPRESS;DATABASE=Transport;UID=john;PWD=peter");
    @

    Can anyone tell me that what might be problem? Do I need to install any supporting software to execute the exe file from other system? My requirement is to run the .exe file from all systems in Lan.

    Thank you in advance.



  • In order to execute the Qt software you need the libraries, however you are executing the file therefor you have installed the libraries, perhaps your sql server isn't configured to accept connection through the network.



  • [quote author="albeo" date="1350439626"]In order to execute the Qt software you need the libraries, however you are executing the file therefor you have installed the libraries, perhaps your sql server isn't configured to accept connection through the network.[/quote]

    Thank you very much albeo for giving the replay. The system which is having Sql Server is configured to accept connection through the network. I Executed the .exe file on other system(having Windows7 and SqlServer) which is having Qt, is executing without a problem. But when I try to execute the same from other system(not having Qt,SqlServer) it is not getting executed.
    What might be the problem?



  • What does QSqlDatabase::lastError() say?



  • [quote author="Lukas Geyer" date="1350451474"]What does QSqlDatabase::lastError() say?[/quote]

    Their are no errors. It is executing fine.



  • First of all, you should check return values and error strings and log them somewhere. Tghis would ease the error detection. As you say, executing the application works, you just get no data, I expect the sql plugin is not loaded / does not work. But to check that, you need more trace / error detection.



  • [quote author="Gerolf" date="1350455525"]First of all, you should check return values and error strings and log them somewhere. Tghis would ease the error detection. As you say, executing the application works, you just get no data, I expect the sql plugin is not loaded / does not work. But to check that, you need more trace / error detection.[/quote]

    Thankyou for your suggestion Gerolf. This might help me. I am having another question to ask, if we give an exe (+required dll's) to any client, do we need to give any supporting software (like any framework ) to execute the exe file on his system or it will work without any installations?
    please do clarify
    Thank you


  • Moderators

    Start by checking out "this document":/doc/qt-4.8/deployment.html for information on deploying Qt applications.



  • [quote author="Gerolf" date="1350455525"]First of all, you should check return values and error strings and log them somewhere. Tghis would ease the error detection. As you say, executing the application works, you just get no data, I expect the sql plugin is not loaded / does not work. But to check that, you need more trace / error detection.[/quote]

    Hello Gerolf, Thank you for your suggestion. As you said I created a logfile to trace the program. It is giving an error like "Driver not loaded Driver not loaded". Can you please help me that what I am missing.
    Thank you in advance.



  • Did you actually install the Qt database drivers you are using?

    Anyway, moving to Installation and Deployment forum.



  • [quote author="Andre" date="1351000676"]Did you actually install the Qt database drivers you are using?
    Anyway, moving to Installation and Deployment forum.[/quote]
    Thank you for your answer. I am getting this error when I try to run the exe file on other system. So can you help me on this that what I am missing?



  • So, did you install the driver plugins or not? If you only send the .exe file, you did not. But that would probably not run at all, as then the Qt .dlls would be missing as well.



  • [quote author="Andre" date="1351002696"]So, did you install the driver plugins or not? If you only send the .exe file, you did not. But that would probably not run at all, as then the Qt .dlls would be missing as well.[/quote]

    Can you please give me a link that how to install driver plugins? I added the required dll's to the exe file.
    Thank you



  • "This documentation page":http://qt-project.org/doc/qt-4.8/deployment-plugins.html gives you some basic pointers, but frankly isn't very clear.

    Take a look at this directory structure:
    @
    myProgram.exe
    QtCore4.dll
    QtSql4.dll
    <other Qt libs>
    sqldrivers\qsqlite.dll
    sqldrivers\qsqlodbc.dll
    sqldrivers<other sql drivers you need>
    @

    The above is quite a normal directory layout. Note the sqldrivers directory with in there the driver plugins. Also note that there are many other classes of plugins you may or may not need. The most frequently used would be the imgeformats plugins, which you need if you use any other image type than PNG.



  • Come on prabuqt... "The same Thread here Once again":http://qt-project.org/forums/viewthread/21159/ why are you posting the same issues again and again....



  • I have merged the two threads. Please don't post the same question more than one time.



  • [quote author="Andre" date="1351063932"]"This documentation page":http://qt-project.org/doc/qt-4.8/deployment-plugins.html gives you some basic pointers, but frankly isn't very clear.

    Take a look at this directory structure:
    @
    myProgram.exe
    QtCore4.dll
    QtSql4.dll
    <other Qt libs>
    sqldrivers\qsqlite.dll
    sqldrivers\qsqlodbc.dll
    sqldrivers<other sql drivers you need>
    @
    [/quote]

    Thank you so much Andre. As you said I just added the following files to the existing
    sqldrivers\qsqlite.dll
    sqldrivers\qsqlodbc.dll.
    now it is working. I am marking the Title as Solved. Thank you so much.



  • Note that if you only use ODBC, you obviously don't need to distribute the qsqlite.dll plugin. It will only add to the weight of your distribution package, and will take time on application startup to load the plugin. Note that all found plugins are loaded, no matter if they are needed by the application or not.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.