On 23.12.07 11:05:18, nishith datta wrote:
> Ok ,
> I went throught he documentation before and yet again.
> I can't figure out what the hell is wrong with this code ;-
> import sys
> >from PyQt4 import QtGui, QtSql
>
> db = QtSql.QSqlDatabase.addDatabase("QPSQL")
> db.setHostName("localhost")
> db.setPort(5432)
> db.setDatabaseName("test")
> db.setUserName("root")
> db.setPassword("mypass")
> print db.open()
>
> Always returns a false , however with psycopg2 , I am able to execute query
> too.
You don't create a QApplication or QCoreApplication, thats needed before
doing any sql-stuff with Qt. It works fine over here.
Andreas
--
Don't go surfing in South Dakota for a while.
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt