[PyKDE] Re: Using QSqlQuery + bindValue = TypeError ?

Jorge Godoy godoy at ieee.org
Sun Feb 27 14:24:06 GMT 2005


Hans-Peter Jansen <hpj at urpla.net> writes:

> On Sunday 27 February 2005 14:37, Jorge Godoy wrote:
> >
> > But I keep always getting the following error message:
> >
> >     query.bindValue(":senha", senhaNova)
> > TypeError: argument 2 of QSqlQuery.bindValue() has an invalid type
> 
> Try:
>     query.bindValue(":senha", QVariant(senhaNova))
> 
> Phil, Qt is able to cast such stuff automatically, IIRC. Why can't 
> PyQt do this for us, too?
> 
> Pete

Thanks, Pete.

It works now.  And yes, Qt does that automatically -- at least that's what in
all examples I've seen while googling for an answer and also on the docs
(even though they don't mention that explicitly).


Now I have to check the database logs and find out why the query wasn't
commited ;-)


Thanks for your help.
Godoy.




More information about the PyQt mailing list