[FWTools] Connecting to PostgreSQL with fwtools

Even Rouault even.rouault at mines-paris.org
Tue Jul 7 12:13:32 EST 2009


Quoting should work too, although it is generally not necessary to do so. I'd 
also bet you forgot to call OGRRegisterAll() before opening your DB.

Le Tuesday 07 July 2009 18:42:55 Frank Warmerdam, vous avez écrit :
> 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,




More information about the FWTools mailing list