<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<font size="2" face="Arial"><br>
I was running an application using PyQt5 for years without any
problem. Suddenly it failed without showing any error.<br>
I checked using a small test program on different PC's:<br>
Windows 10 /11<br>
Python 3.14 (64 bit)<br>
PyQt5 5.15.11 <br>
<br>
Test program: <br>
<br>
</font><font size="2"><font face="monospace">from PyQt5 import
QtSql <br>
from PyQt5 import QtGui<br>
import sys<br>
app = QtGui.QGuiApplication(sys.argv)<br>
filepath=r"pathto\\MY_ACCESS.MDB"<br>
<br>
db = QtSql.QSqlDatabase.addDatabase("QODBC")<br>
db.setDatabaseName(r"Driver={Microsoft Access Driver (*.mdb,
*.accdb)};DBQ=%s;" % filepath)<br>
if db.open(): <br>
print("opened")<br>
print(db.tables())</font><br>
</font><font size="2" face="Arial"><br>
On my PC with the sudden problem application it fails silently.<br>
On my laptop is runs ok.<br>
On my old laptop (windows 10) it fails also.<br>
<br>
When inspecting the data source (64bit) : It shows the following
difference: <br>
Working PC: Microsoft Access Driver (*.mdb, *.accdb) version:
16.00.19328.20010 <br>
</font><font size="2" face="Arial">Non working PC's: Microsoft
Access Driver (*.mdb, *.accdb) version: 16.00.19628.20024 </font><br>
<font size="2" face="Arial"> <br>
The strange thing that is happening is when I run a test using
only pyodbc (5.3.0) without any PyQt5 import, it works on all
PC's:<br>
<br>
test script: <br>
<br>
</font><font size="2" face="monospace">import pyodbc<br>
</font><font size="2" face="Arial"># from PyQt5 import QtGui</font><br>
<font size="2"><font face="monospace">filepath=r"pathto\\MY_ACCESS.MDB"</font></font><br>
<font size="2" face="monospace"><br>
connection = pyodbc.connect(r"Driver={Microsoft Access Driver
(*.mdb, *.accdb)};DBQ=%s;" % filepath)<br>
print(dir(connection))<br>
if not connection.closed:<br>
cursor = connection.cursor()<br>
for row in cursor.tables():<br>
print(row.table_name)</font><font size="2" face="Arial"><br>
<br>
When I uncomment in the above script the line "</font><font
size="2" face="monospace"># from PyQt5 import QtGui</font><font
size="2" face="Arial">" it fails again on the 2 problem PC's </font><br>
<font size="2" face="Arial"><br>
Any help is much appreciated<br>
<br>
<br>
<br>
<br>
<br>
<br>
</font>
</body>
</html>