My exe app not connecting to database in other systems.
-
Laptop 1.
My Python codes run well as expected without any error. It has a GUI built with PyQt5 with data stored in the database (Microsoft SQL server)I created exe (standalone) files which run very well. When I copy these exe files created in Laptop 1 to laptop 2, they work fine. Laptop 1 and Laptop 2 have Microsoft SQL server and Mysql server.
Laptop 2:
The same codes in Laptop 1 run well in Laptop 2. When I create exe files in Laptop 2, they run fine and connect to the database well. But when I copy the created exe files to other systems, they run well but don't get connected to the database.
I've not tried copying them to Laptop 1 because presently I'm not with Laptop 1. I copied the exe files created in Laptop 2 to Laptop 3 (Laptop 3 doesn't have any SQL server), they run fine but don't get connected to the database.
I shared the exe files to some of my friends who run them on their systems too. The apps open well but don't get connected to the database server.
Does anyone know the reason for this?
-
@CEO
We know nothing about how you create exe files for Python scripts. Some tool. Perhaps different situation in what it packages from laptop #1 versus #2, anyone's guess.To diagnose database connection failures: make sure you check returns results from database connection attempts, and print out whatever is supplied as "error message" when they fail.
If you are using Qt's
QSql...
classes, set environment variableQT_DEBUG_PLUGINS=1
before you run your executable and look at the diagnostic output to see if failure.If you are using Python's own SQL modules use its documentation or ask in a Python forum.
-
@CEO
I did not notice you were the poster. You are right, everyone who reads this other than me knows just what you do to turn your python script into an "exe (standalone) file", because there is only one way to do that, and they know just what it entails. And they also know from your post whether you are using Qt functions to access the database or Python ones. -
@JonB said in My exe app not connecting to database in other systems.:
If you are using Qt's
QSql...
classes, set environment variableQT_DEBUG_PLUGINS=1
before you run your executable and look at the diagnostic output to see if failure.
If you are using Python's own SQL modules use its documentation or ask in a Python forum.Are you using
QSql...
classes (I can maybe help) or Python ones (I can't)? -
Hi
On laptop 2 , did you install the ODBC drivers
as step 3 says.