Attempt to connect to database using libpq++ PgDatabase class fails because CONNECTION_BAD

Поиск
Список
Период
Сортировка
Искать

Attempt to connect to database using libpq++ PgDatabase class fails because CONNECTION_BAD

От:
"Paul Meisenheimer" <Paul.Meisenheimer@digeo.com>
Дата:
I am porting code from Red Hat Linux to Windows 2000 and can not connect to a 
my database using libpq++.

I have installed CygIPC and PostgreSQL as Services on my Windows 2000 PC.
I have created a database (called mediadb).
I have added tables to the database.
I have added data to the tables.

I can access the database using psql from a Cygwin Bash Shell (e.g.):
$psql -q -d mediadb -U mediadbuser
mediadb=# select count(*) from guide_programinfo; count------- 24532(1 row)

I can not access the database from my application using libpq++ (CONNECTION_BAD):
#include #include #include #include "libpq++\pgdatabase.h"
using namespace std;
int main(int argc, char* argv[]){	PgDatabase myDB("dbname=mediadb user=mediadbuser");
	if ( myDB.ConnectionBad() )	{
>>>			cout << "Failed to open " << endl;	}	else	{		cout << "Opened " << endl;	}
	return 0;}

I am using standard (unmodified) configuration files:
C:\cygwin\usr\share\postgresql\data\pg_hba.confC:\cygwin\usr\share\postgresql\data\postgresql.conf...

Any help would be greatly appreciated!





FAQ