[PyQt] unable to load the postgre sql drivers in pyqt
nishith datta
nkdiitd2002 at yahoo.com
Sun Dec 30 10:28:33 GMT 2007
hi all,
I have installed python 2.5 , QT 4.3.3 opensource with mingw, and pyqt 4.3.1-1 on a winXP machine.
I am trying to establish a connection to the postgres SQL 8.2 database on my machine using the pyqt . The code is as under :-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4 import QtSql
db = QtSql.QSqlDatabase.addDatabase("QPSQL")
db.setDatabaseName("test")
db.setUserName("root")
db.setPassword("mypass")
name = db.open()
print db.lastError().text()
I get an error driver not loaded . I can't understand how to have the psql driver loaded.
Can someone help me out.
By the using psycopg2 I can easily establish connection and also execute queries on the database.
thanks in advance.
nishith
---------------------------------
Never miss a thing. Make Yahoo your homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20071230/33857f29/attachment.html
More information about the PyQt
mailing list