Thread: Inquiry From Form [pgsql]

Inquiry From Form [pgsql]

From
jcvacher
Date:
Hello
I have a little problem:
I have a postmaster started on a NT workstation. And i try do do a little sample to do a select request with the c api.

In the main I do that:

VersionRequested = MAKEWORD(2, 0);
Error = WSAStartup(VersionRequested, &WsaData);
if (Error) {
    printf(\"Could not find high enough version of WinSock\\n\");
    exit(-1);
}
PGconn *myConnection = PQsetdb(\"localhost\", \"5432\", NULL, NULL, \"mydb\");


But the result of \'PQstatus(myConnection)\' is always CONNECTION_BAD with the error message:
\'could not send startup packet: Socket is not connected\'


Have you an idea of the problem?

Cordially

Jean-Christophe VACHER