Active5 years, 1 month ago
I'm new here I want to run this code :
when I try to run it I become this fault
'La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours' Napoleon Bonaparte On a crusade to banish setIndexWidget from the holy land of Qt.
- QSqlDatabase setDatabaseName for the QOCI (Oracle) driver, the database name is the TNS Service Name, as been said in Qt Developer Reference, but in practice call to setDatabaseName('MyService') sets up SID=MyService, instead of SERVICENAME=MyService!
- The QSqlDatabase class provides an interface for accessing a database through a connection. An instance of QSqlDatabase represents the connection. Including your own custom drivers, can be loaded dynamically. For the QOCI (Oracle) driver, the database name is the TNS Service Name. For the QODBC driver.
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7
I have window7, 32 bit System , Msql 5.1.72, qt.5.1.1, visual Studio 2010
Any advice please ?
zessx59.8k25 gold badges107 silver badges143 bronze badges
The ManThe ManQsqldatabase Qsqlite Driver Not Loaded
1341 gold badge4 silver badges17 bronze badges
2 Answers
The error message hints that you have missed the QMYSQL
plugin. You may take a look at Qt Documentation on how to build it on Windows.
Qsqlite Driver Not Loaded
vahancho16.9k3 gold badges28 silver badges36 bronze badges
Sometimes it is only need to Copy libmysql.dll
from %mysql%lib
to C:Windows
7,6283 gold badges24 silver badges57 bronze badges
garrygarry