ecpg - Mailing list pgsql-novice

From Chris McNett
Subject ecpg
Date
Msg-id F183dxXgsAI3lZebU7I00008492@hotmail.com
Whole thread Raw
List pgsql-novice
(Remember to reply to both me and the list, as I do not subscribe to the
list.)

I am using ecpg and get error -402 (cannot connect to database).  The
database works fine with the psql command.  It probably won't help, but here
is my code:

#include <stdio.h>

main()
{
  EXEC SQL BEGIN DECLARE SECTION;
  /* list of declarations */
  EXEC SQL END DECLARE SECTION;
  int i;
  EXEC SQL INCLUDE sqlca;
  EXEC SQL CONNECT databasename; /* error happens here */
  if(sqlca.sqlcode)
    printf("Error connecting to database server.<br>errcode
%d",sqlca.sqlcode);
  /* more code to access database */
  EXEC SQL COMMIT RELEASE;
  return(0);
}

It compiled fine and linked successfully with libecpg and libpq.

Thanks!
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.


pgsql-novice by date:

Previous
From: David Slayton
Date:
Subject: Multiple Selects
Next
From: "Jochen Weyermanns"
Date:
Subject: Re: ecpg