[PyQt] Database Connection still does not work...

Matt Newell newellm at blur.com
Mon May 7 18:33:08 BST 2007


>
> Hi again,
>
> I finally managed to successfully build Qt with makefiles and have now
> libqsqlpsql.dll in plugin directory. I have also set environmentvariables
> (as I don't have admin rights on my PC here at work, I always run this
> batch file in cmd shell:
>
> set Path=C:\Bin;C:\Bat;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;
> C:\python25;C:\Qt\4.2.3\bin;C:\PyQt4.2\;C:\Programme\qgistrunk;C:\mingw\bin
>;
> C:\Programme\PostgreSQL\8.2;C:\cmake\bin;C:\mingw\include;C:\Programme\Post
>greSQL\8.2 set PGLIB=C:\Programme\PostgreSQL\8.2\lib
> set PGINCLUDE=C:\Programme\PostgreSQL\8.2\include
> set PGBIN=C:\Programme\PostgreSQL\8.2\bin
> set PGDATA=C:\Programme\PostgreSQL\8.2\data
> set PGUSER=postgres
> set QT_DEBUG_PLUGINS=1
>
> when I then run Python from shell and just want to test if it's possible to  
creat a connection, the same errormessage occured...:
> > >from PyQt4.QtSql import *
> >
> > QSqlDatabase.addDatabase("QPSQL")
> >
> > in Python Interpreter, then the error-message "QSqlDatabase: driver not
> > loaded
> > QSqlDatabase:
> > available drivers
> >  PyQt4.QtSql.QSqlDatabase object at 0x008E58A0"
>
> So, I really don't know what goes wrong with this...
>
> Would be so great, if anyone can help me to step forward with this stuff
> :-)
>
> Thanks in advance,
> Marion.


Would you please paste the python code you are using to connect to the 
database. 

Matt


More information about the PyQt mailing list