| From: | Aristide Aragon <aristide(at)lionking(dot)org> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Help with pq++ |
| Date: | 2001-02-25 01:11:19 |
| Message-ID: | 20010224191119.C6862@busa.lionking.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hello
I need to make a program that uses pq++, before starting I made a little program to see if I understood correctly how to use pq++, however I have a problem: The program can't connect to the DB.
My code looks like this:
#include <stdio.h>
#include <libpq++.h>
int main()
{
PgDatabase db("dbname=mydb");
if (!(db.ConnectionBad()))
{
printf("OK\n");
exit(0);
}
else
{
printf("Error connecting\n");
exit(1);
}
}
And no matter what I do (I tried with the env variables PGHOST, PGPORT, PGDATABASE and PGUSER) the program always gives me "Error connecting".
Can somebody help? I was expecting to have problems, but not this early.
Aristide
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Matt Beauregard | 2001-02-25 01:45:06 | Help with database locking |
| Previous Message | bcs-brockmann.de | 2001-02-24 20:27:48 | key in psql |