[FWTools] Connecting to PostgreSQL with fwtools

Frank Warmerdam warmerdam at pobox.com
Tue Jul 7 11:42:55 EST 2009


Flavio Perri - QMap srl wrote:
..
>     dataSource = 
> OGRSFDriverRegistrar::Open(connectionSTR.c_str(),TRUE,NULL);
> 
> -----
> 
> dataSource is NULL, the generated connectionSTR is this:
> PG:dbname='postgis' host='localhost' port='5432' user='postgres' 
> passwd='postgres'
> 
> where is my fault?

Flavio,

I am not aware of having quoted stuff like the value applied to dbname=
in the past.  Why are you doing it?  I would suggest printing out
the return value of CPLGetLastErrorMsg() if the Open fails.  Are you
sure you are registering all the drivers before calling open?

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the FWTools mailing list