qtsql

Why QOCI plugin isn't working

左心房为你撑大大i 提交于 2019-12-12 02:25:25
问题 I am trying to use Qt with QOCI (actually, along with other plugins as well) but for some reason I cannot. Here is what I did and result: 1- http://doc.qt.nokia.com/latest/sql-driver.html#qoci plug-in is built successfully. 2- copied the plugin debug & release dll and lib files to plugins/sqldrivers and OCI.DLL to %WINDIR%\system32 (plugins/sqldrivers is where other plugins such as QPSQL and QMYSQL are) 3- QSqlDatabase::isDriverAvailable(QOCI) returns false where it returns true for QMYSQL

“cannot locate symbol ”stpcpy“” Using QTDS driver on Android

霸气de小男生 提交于 2019-12-11 10:06:56
问题 Hi everyone in the forum, I'm writing because i'm trying to use de QTDS driver to access a sybase database from an android devices. Reading the Qt5 Documentation I found instructions of how to build the qtds plugin, so I download the freetds library and compile it with the android NDK and copy the .so files to my project under the android/libs/armeabi-v7/freetds/lib/ directory. Also I compile the pluging for android using these .so an copy the libqsqltds.so file to the QtDir/5.5/android_armv7

QtSQL - QMYSQL driver not loaded (Ubuntu)

烂漫一生 提交于 2019-12-11 08:43:58
问题 I want to access a SQL database via PyQt4 on Ubuntu. I already installed apt-get install python-qt4-sql but when I add a Database like this: import sys from PyQt4 import QtGui, QtCore, QtSql appcore = QtCore.QCoreApplication(sys.argv) db = QtSql.QSqlDatabase.addDatabase('QMYSQL') db.setHostName('localhost') db.setDatabaseName('database1') db.setUserName('root') db.setPassword('root') if db.open() == False: print 'fail' I get the error QSqlDatabase: QMYSQL driver not loaded QSqlDatabase:

Using QSqlQuery from multiple threads

对着背影说爱祢 提交于 2019-12-11 06:18:18
问题 I have a lot of C++11 threads running which all need database access at some time. In main I do initalize the database connection and open the database. Qt documentation says that queries are not threadsafe so I use a global mutex until a QSqlQuery exists inside a thread. This works but is that guaranteed to work or do I run into problems at some time? 回答1: A look at the Documentation tells us, that A connection can only be used from within the thread that created it. Moving connections

Qt embedding MYSQL

前提是你 提交于 2019-12-11 05:54:18
问题 This Question has been asked by different people about 3times by QLands: here and carnifrex: here and there. My problem is exactly like carnifrex's: I am trying to compile my application to connect to MYSQL(Mariadb) database without Mariadb installation i.e embedded server but I get this Error Below: error: undefined reference to 'imp__ZN12QMYSQLDriverC1EP8st_mysqlP7QObject' collect2.exe:-1: error: error: ld returned 1 exit status Unfortunately, carnifrex was not replied. Here's my Code main

cx_freeze: QODBC driver not loaded

冷暖自知 提交于 2019-12-11 02:39:18
问题 my python application looks like: test.py from PyQt4 import QtCore from PyQt4 import QtGui from PyQt4 import QtSql import sys import atexit if __name__ == "__main__": app = QtGui.QApplication(sys.argv) db = QtSql.QSqlDatabase.addDatabase('QODBC') sys.exit(app.exec_()) If i run this application, everything works fine. However, if I create an executable with cx_freeze, I always get the following error: QSqlDatabase: QODBC driver not loaded QSqlDatabase: available drivers: I use the following

Problem with QIBASE (firebird + Ubuntu)

霸气de小男生 提交于 2019-12-06 14:39:13
Good morning. I've tried to compile QIBASE driver to access FireBird database using sqlbrowser from %QTDIR/demos. But after i filled all fields in sqlbrowser and pushed OK button the program crashed with message: /opt/qt-everywhere-opensource-src-4.7.3/demos/sqlbrowser-build-desktop/sqlbrowser: symbol lookup error: /usr/lib/qt4/plugins/sqldrivers/libqsqlibase.so: undefined symbol: isc_attach_database To compile QIBASE driver i've done following steps: Installing FirebirdCS-2.5.0 to /opt/firebird. Unzipping qt sources to /opt/qt4. Compiling QIBASE driver: cd /opt/qt/src/plugins/sqldrivers/ibase

Qt SQL prepare fails

会有一股神秘感。 提交于 2019-12-06 04:21:56
I'm trying to run this Qt code QString serverName = "localhost"; QString dbName = "zfserver"; QString userName = "root"; QString passWord = "123456"; QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); db.setConnectOptions(); db.setHostName(serverName); db.setDatabaseName(dbName); db.setUserName(userName); db.setPassword(passWord); if(db.open()) { QSqlQuery query; query.prepare("INSERT INTO account (name, email, password, type) " "VALUES (:name, :email, :password, :type)"); query.bindValue(":name", "atef"); query.bindValue(":email", "asfasf@gfasga.com"); query.bindValue(":password", "123");

How to load ODBC in qt

别等时光非礼了梦想. 提交于 2019-12-05 18:35:34
I'm very new to Qt and C++ I'm trying to connect to an ODBC db, but I'm getting the following output QSqlDatabase: QODBC driver not loaded QSqlDatabase: available drivers: QSQLITE How do I load ODBC in Qt . CODE : QString serverName = "LOCALHOST\\SQLEXPRESS"; QString dbName = "test"; QSqlDatabase db = QSqlDatabase::addDatabase("QODBC"); db.setConnectionOptions(); QString myCon = QString("DRIVER={SQL Native Client};SERVER=%1;DATABASE=%2;Trusted_Connection = Yes").arg(serverName).arg(dbName); db.setDatabaseName(myCon); if(db.open()) { qDebug() << "Opened!"; db.close(); } else { qDebug() <<

QtSql application not working on the deployed machine

ε祈祈猫儿з 提交于 2019-12-04 07:00:58
问题 I made a software in Qt/C++. I need to deploy it on Windows 7 (64 bit), which is also the host machine on which I developed the software. The problem is that my software can interact with the sqlite database on the developed machine, but when I try to deploy my software on some other machine, it can't interact with the database there. I tried to use "Run as Administrator", too, but it did not help. I also tried to use the compatibility mode as well. The database is located locally at C:\Users