[Qgis-user] QgsDataSourceURI.setConnection() error

Düster Horst Horst.Duester at bd.so.ch
Mon Apr 6 04:56:41 EDT 2009


With PyQgis 1.1.0 I want to connect to a PostGIS layer via Python plugin
with

...
uri = QgsDataSourceURI()
uri.setConnection(self.DBHOST, self.DBPORT, self.DBNAME, self.DBUSER,
self.DBPASSWD)
...

Unfortunately QGIS throws the following Python error message:
Error:
uri.setConnection(self.DBHOST, self.DBPORT, self.DBNAME, self.DBUSER,
self.DBPASSWD)
TypeError: insufficient number of arguments to
QgsDataSourceURI.setConnection()

With respect to the class documentation setConnection() has exactly the
number of arguments I use in my Python code. Furthermore the same code
works fine with QGIS 1.0.0.

I'm a little bit confused and I appreciate any hint.

Regards
Horst


------------------------------------------------

Dr. Horst Düster
Stv. Amtschef / GIS-Koordinator 

Kanton Solothurn
Bau- und Justizdepartement
Amt für Geoinformation
SO!GIS Koordination
Rötistrasse 4
CH-4501 Solothurn

Telefon ++41(0)32 627 25 32
Telefax ++41(0)32 627 22 14

mailto:horst.duester at bd.so.ch
http://www.agi.so.ch


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-user/attachments/20090406/44d41fa6/attachment.html


More information about the Qgis-user mailing list