[PyQt] Database Connection

Matt Newell newellm at blur.com
Fri May 4 18:45:17 BST 2007


On Friday 04 May 2007 06:14, marion.balthasar at ise.fraunhofer.de wrote:
> Hello list,
>
> I'm quite new to Python and PyQt. So I would be very thankful, if anyone
> could help me with my starting problems...
>
> I'm planning to write some Python Plugins for QuantumGIS. The function of
> those Plugins should be to connect to a PostgreSQL/PostGIS Database and
> commit SQL-Queries, which in return should export Data through a form
> (written to a comma seperated textfile).
> Does anyone know, if there are any scripting-examples dealing with that or
> a similar problem, just to get a clou....
>
> I'm now experimenting with QtSql Classes, but every try to connect to my
> database, explained in PyQt's Class reference documentation fails... (I
> tried with Python interpreter shell)
>
> Thanks for every given hint...!
>
> greets,
> Marion

Have you been able to successfully connect to the database via pgadmin or 
another tool from the same machine?  What's the error message you get when 
the connect fails(QSqlDatabase.lastError().text())?

Matt


More information about the PyQt mailing list