Skip to main content
Filter by
Sorted by
Tagged with
2 votes
0 answers
100 views

I've run into an issue with PySide6 that I cannot subclass QSqlDatabase. My biggest complaint about the QtSql system is that it does not throw exceptions when things go wrong. You have to manually ...
bfris's user avatar
  • 5,933
1 vote
0 answers
29 views

Im writing a C++ program using QtCreator, Qt 6.9.0 and llvm-mingw1706_64 in Windows11. It is an user interface toward a MySql database. If I run the program normally, it can access database with no ...
Riccardo Carassale's user avatar
0 votes
0 answers
47 views

I have an application (Qt 5.15.2) where values of an QSqlTableModel are modified by Retrieving a copy of the record with QSqlTableModel::record(int row) Modifying values with QSqlRecord::setValue(int ...
avb's user avatar
  • 1,761
2 votes
0 answers
41 views

I have a basic database setup using postgresql. One of the columns has a real[] data type set, but no matter what I do the resulting value from a qsqlquery returns a string type instead of an array or ...
ils_fl's user avatar
  • 21
0 votes
1 answer
109 views

I'm writing a C++ app with Qt that needs to connect to a MySQL database. I can't seem to get QSqlDatabase to actually load the actually available QMYSQL plugin. Qt 6.7.2. on Mac (macOS 12.7.6, x86_64,...
Lamont Peterson's user avatar
0 votes
0 answers
65 views

I'm writing a QT program with a lot of database queries. The QSqlDatabase is not thread safe as the documents states. So I wrote a simple thread_local QSqlDatabase to maintain a database connection ...
Chou Tan's user avatar
0 votes
0 answers
60 views

my code outputs the error QSqlDatabasePrivate::removeDatabase: connection 'createRequestConnection' is still in use, all queries will cease to work. although there is not even a QSqlQuery query, I ...
zxctatar's user avatar
  • 133
1 vote
0 answers
171 views

We are trying to write concurrently to a SQLite database, using WAL mode, to a network location. We don't have the privileges of having a server-based database (Postgres, MySQL, etc) so we have to ...
R41nMak3R's user avatar
0 votes
1 answer
50 views

The debug version of my project runs perfectly and the release version also runs except for the sqlite code. I get the following error messages: "QSqlDatabase: QSQLITE driver not loaded. ...
Charlie's user avatar
0 votes
1 answer
551 views

In How to solve "QSqlDatabase: QMYSQL driver not loaded", this answer says that libqsqlmysql.a and libqsqlmysqld.a files should exist in <QtDir>\mingw73_xx\lib folder. But I cannot get ...
mrtz-dvlpr's user avatar
1 vote
0 answers
407 views

Currently I have this code: Orders::Orders(QObject *parent) : QObject{parent} { QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL", "orders"); db.setHostName("...
Mark's user avatar
  • 5,355
0 votes
0 answers
172 views

I found other similar questions with the same error (i.e. this and this) but apparently all of them are related to a wrong library / configuration since the users cannot connect to the database at all....
Mark's user avatar
  • 5,355
-1 votes
1 answer
84 views

I am creating a simple app for modifying SQLite databases. I am trying to add new rows in MainWindow::on_AddButton_clicked() method, but when I use the MainWindow::on_reselectTable_clicked() method ...
Waldemar _'s user avatar
0 votes
1 answer
274 views

I want to import a database from disk to memory at application start and on exit export back from memory to disk. I converted this code from C++ to Python. It successfully exports the database from ...
tom's user avatar
  • 1,354
1 vote
0 answers
208 views

I wanna make a MySQL database mapping to QTableView but i got this error: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QMYSQL3 QODBC QODBC3 QPSQL ...
KsOnd's user avatar
  • 11
0 votes
1 answer
232 views

The problem is that the database connection can be unstable, so at the beginning of the program it is easy to check this with if(!db.open()). But some cases can happen while the application is running....
user avatar
0 votes
0 answers
48 views

I can't figure out the strange display behavior of QSqlRelationalTableModel. setEditStrategy of the model is set to OnFieldChange. I'm trying to change the values in the cells, but the whole row ...
papadulo's user avatar
0 votes
1 answer
175 views

I have a server with a MariaDB Database. Then I have a python program who run in a client where I have this code: def Connect(): # Credential reading from register servHost = RegRead(&...
Rinfra90's user avatar
1 vote
0 answers
475 views

Got troubles with using QSqlDatabase::transaction(). I want to start a transaction of Sqlite in Qt and I know this function : bool QSqlDatabase::transaction(): if(db.transaction()) { QSqlQuery ...
LutionYoung's user avatar
1 vote
0 answers
911 views

I'm playing around with PyQt6 and QSQL. The code down here was meant to load a sqlite3 database into a QTableView But instead, it will load only the headers of a table into the table view. What do I ...
Gregorick's user avatar
0 votes
0 answers
236 views

I can open the XLSX Excel format and read all data but only if the code for it is part of the constructor of the QMainWindow. For first tests to read the Excel it was fine. But when I move the ...
Lodhart's user avatar
  • 225
1 vote
1 answer
347 views

I have a small problem trying to propoerly parse a .txt files and show its content on a QTableView. Specifically how to extract the headers of the file and show them into a QTableView. The .txt file ...
EsoMars's user avatar
  • 357
1 vote
0 answers
144 views

I am writing a pyqt5 qui that interfaces with my psql DB via SQslDatabase. External-to-me processes have a listen/notify setup to communicate status to other components via the database. So, my gui ...
RuslanS's user avatar
  • 13
0 votes
1 answer
233 views

When creating table at run time using qsqlquery the fields of the sqlite database table are declared by user, and using that I want to create a table at run time. How can I do that in qsql cpp? ...
in.yssh's user avatar
  • 33
0 votes
1 answer
167 views

I am using c++ QSQLDatabase (SQLITE driver) to interact with an sqlite3 database. The c++ code uses queries that have the database's name before the table name like this : SELECT * FROM database_name....
Mike's user avatar
  • 1
0 votes
1 answer
263 views

I have a Qt application, using QSqlDatabase, and I need to take a different action on a unique key constraint violation as opposed to any other type of error. Currently, the backend database is SQLite,...
HiddenWindshield's user avatar
0 votes
1 answer
402 views

This won't work: { QSqlDatabase db; db.addDatabase("QSQLITE", "manDb"); QString path = QDir::currentPath()+"/"+"Sqlite.db"; db.setDatabaseName(...
in.yssh's user avatar
  • 33
0 votes
1 answer
162 views

I am trying to have multiple QPSQL QSqlDatabase connections in my application. When I use only one connection - default/ no name, - it works flawlessly. But as soon as I try to create a named ...
Dmitriy G's user avatar
0 votes
1 answer
166 views

Qt 6.2.0, Ubuntu 21.10. Usually MariaDb stores database under /var/lib/mysql/ directory. I can connect to my own database using this working code: _db = QSqlDatabase::addDatabase("QMYSQL", &...
Mark's user avatar
  • 5,355
-1 votes
1 answer
46 views

This is an example,Im trying combine two tables here which are db_match and country as you can see but I need to extract just month from the whole date so what could I try here ? I tried, update ...
supraja's user avatar
1 vote
0 answers
35 views

I am using the following code to create an NEW MS Access file using the SQL API from Qt. QString strDatabaseName; if (strExt == ".DB") { oQtDatabase = QSqlDatabase::addDatabase(_TN("...
Graphman's user avatar
1 vote
1 answer
228 views

This is what I have so far: def save_invoice(self): con = QSqlDatabase.addDatabase("QODBC") con.setDatabaseName("C:/Users/Egon/Documents/Invoice/Invoice.accdb") # ...
accpert.com's user avatar
0 votes
0 answers
26 views

I can't access the SQL related drivers in PyQt5. I need said drivers to do everything. I installed PyQt5 with Anaconda I started with code to create the connection, check that the connection works, ...
CatalunaLilith's user avatar
0 votes
0 answers
365 views

I've already got an infrastructure to work with. There is an insert function given with the following signature: insert(const QString& key, const QVariant& value) Within the function the ...
Attis's user avatar
  • 633
0 votes
0 answers
885 views

I'm trying to connect to a PostgreSQL 13 database from PyQt/PySide. When I get to con = QSqlDatabase.addDatabase('QPSQL'), I get the following console output: QSqlDatabase: QPSQL driver not loaded ...
Moley's user avatar
  • 33
0 votes
2 answers
1k views

I'm working on a scenario where we want to asynchronously execute INSERT/DELETE statements on a database table (it's a fire-and-forget scenario). I'm planning to simply fire a signal with relevant ...
Tim Meyer's user avatar
  • 12.7k
0 votes
1 answer
2k views

I was writing simple code using SQLite database in Qt: QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); QSqlQuery query; query.exec("CREATE TABLE IF NOT EXISTS test(id, name)&...
max paint's user avatar
1 vote
1 answer
195 views

I'm struggling on a very uncommon failure. I had a program running which attaches a configuration database to a production database. I used the ATTACH DATABASE command from sqlite. It was working fine ...
Papageno's user avatar
  • 354
0 votes
1 answer
220 views

Work on a project and I want to make spinBox values saved in the database .. but the code does not work for me .. The result I want to get: For example, when changing the value of spinBox_1 to 5 and ...
Rachid Ben abdelmalek's user avatar
1 vote
1 answer
84 views

Below is my example code: from PyQt5 import QtCore, QtGui, QtWidgets, QtSql from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtSql import * import sys ...
user3030327's user avatar
0 votes
0 answers
1k views

I am trying to create a PostgreSQL database with PyQt5. After creating a database using QSqlDatabase.addDatabase(), calling lastError().text() on that object returns the following: Driver not loaded ...
gearmic's user avatar
  • 47
1 vote
1 answer
2k views

I have a requirement where I have to execute multiple queries and perform group by on a column with where clause , group by column is fixed and where condition will be perform on fixed column with ...
sam's user avatar
  • 47
1 vote
2 answers
460 views

I have a table where I have to perform group by on dynamic columns and perform aggregation, result will be column values concatenating group-by tables and aggregations on col supplied by users. For ...
sam's user avatar
  • 47
1 vote
0 answers
1k views

I am getting the driver not loaded error when trying to open an sqlite database with Qt 5.15.0 on Windows. Here is my output: QSqlDatabase: QSQLITE driver not loaded QSqlDatabase: available drivers: ...
antzcrashing's user avatar
0 votes
1 answer
478 views

Is there anyway to join 3 columns to create a new column with the date value I have a column name Month Day Year and I need to join them and show the date result of the values form those columns
skaailet's user avatar
2 votes
1 answer
324 views

I love all of the goodness you get from QSqlDatabase and QSqlQuery and various models. But I would really like exceptions to be thrown when errors occur. So I thought maybe I could subclass ...
bfris's user avatar
  • 5,933
0 votes
0 answers
782 views

I created db handling class with Qt's SQL : // constructor of my db handler class DBHandler::DBHandler(QObject *parent) : QObject(parent) { QSqlDatabase db = QSqlDatabase::addDatabas("QMYSQL", "...
Dean Lee's user avatar
  • 147
0 votes
0 answers
279 views

I have a 500MB file which contains a data that I need to use it to update a table that contains 10M rows so I use this code in using QT SQL library QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"...
user7179690's user avatar
  • 1,133
-1 votes
1 answer
632 views

im writing a code in python and i need to fil a table with a database select, and also refresh it every 5 minutes, dos anyone can help me with it? i already tryied alot of ways, but none was right. ...
The X and D's user avatar
0 votes
1 answer
119 views

I have a Thread, which opens a database and emits a signal. The main idea is to check if the database is still there and valid. If the database is offline (MYSQL), QSqldatabase is trying for about 3 ...
user avatar