[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] qtable data source
From: Andreas Pakulat <apaku () gmx ! de>
Date: 2007-12-23 19:33:35
Message-ID: 20071223193335.GA23180 () morpheus ! apaku ! dnsalias ! org
[Download RAW message or body]
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 PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic