Hi to all folks here.
i am trying to open a QSqlDatabase connection to an Sql Server of mine. I have created an ODBC data source callded "herc" in the Windows and wrote this code:
from PyQt4 import QtSql
db = QtSql.QSqlDatabase.addDatabase("QODBC");
db.setDatabaseName("herc");
db.setUserName("sa");
db.setPassword("the paswsword");
ok = db.open();
but i receive: "QSqlDatabase: QODBC3 driver not loaded
QSqlDatabase: available drivers: "
I am using Qt4.2 Open Source edition, i read the docs and i think that the above is correct. Do i have to do something else too to have this thing work ??
Thanks a lot for any help!





Reply With Quote
Bookmarks