problem connecting with libpq++ interface - Mailing list pgsql-interfaces

From Deniz Hastorun
Subject problem connecting with libpq++ interface
Date
Msg-id 000d01c031ce$9ed29a00$25054ba0@cc.itu.edu.tr
Whole thread Raw
Responses Re: problem connecting with libpq++ interface  (Adam Haberlach <adam@newsnipple.com>)
List pgsql-interfaces
Hi everybody,

I have a really strange problem . I'm trying to connect to PostgreSQL db
from witin my C++  program and using the libpq++ interface functions . But
strangely it won't connect and I'm receiving the following error message

connection to db failed.Error returned:ERROR: PQconnectdb() - Missing '=' after 'template1' in
conninfo

.here's my code
PGconn *conn1;
const char * dbname="template1";
PgDatabase data(dbname);conn1=PQconnectdb(dbname);if (data.ConnectionBad()){    cerr<<" connection to db failed."<<
endl       <<" Error returned:" <<  data.ErrorMessage() << endl;    exit(1);}
 

any idea would be appreciated. thanks in advance!
deniz



pgsql-interfaces by date:

Previous
From: Ken Schrock
Date:
Subject: ...
Next
From: nicolas boretos
Date:
Subject: ODBC w/ 7.02