From: | "Chris McNett" <chrismcnett(at)hotmail(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | ecpg |
Date: | 2000-09-09 23:39:58 |
Message-ID: | F183dxXgsAI3lZebU7I00008492@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Jochen Weyermanns | 2000-09-11 06:37:54 | Re: ecpg |
Previous Message | Tom Lane | 2000-09-09 02:24:52 | Re: prepared statement support? |