--_434befaa-b74e-49a4-8729-19a6533fe886_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Fellows
=20
I still have problem to access my databank.It shows syntax problem=2CI am
u=
sing VC++ 2005 with postgresql 8.3.My table name is Person and it has
three=
column=2CPerson ID=2Cfirst name and last name (testing version).whole c++
=
code is=20
=20
=20
// Test_postgres.cpp : Defines the entry point for the console
application.
//
#include "stdafx.h"
#include "libpq-fe.h"
=20
=20
int _tmain(int argc=2C _TCHAR* argv[])
{
const char *conninfo=3B
PGconn *conn=3B
const char *paramtext =3D "server_version"=3B
PGresult *res=3B
conninfo =3D "hostaddr =3D 127.0.0.1 dbname =3D Salman_db user =3D
postgres=
password =3D 732047"=3B
conn =3D PQconnectdb(conninfo)=3B
if (PQstatus(conn) !=3D CONNECTION_OK)
{
printf("Unable to establish connection: %s"=2C
PQerrorMessage(conn))=3B
return 1=3B
} else
{
=20
res =3D PQexec(conn=2C "INSERT INTO public.Person VALUES (221=2C'Siddiqi'=
=2C'Umer')")=3B
if (PQresultStatus(res) !=3D PGRES_COMMAND_OK)
{
printf("Problem with command: %s\n"=2C PQerrorMessage(conn))=3B
PQclear(res)=3B
PQfinish(conn)=3B
return 1=3B
}
PQclear(res)=3B
}
PQfinish(conn)=3B
return 0=3B
}
=20
It shows no relation between public and person=2Cif i write only person
=2C=
it show =2CPerson doesn't exist.
=20
hope=2C u ppl can help me.
=20
Sheikh Salman AhmedDiplomand in Nano Struktur TechnologieDuisburg-Essen
Uni=
versit=E4tMobile : 0049-179-9463738Home :0049-203-3945028
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live
Space=
s. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=3Dcreate&wx_url=3D/friends.=
aspx&mkt=3Den-us=
--_434befaa-b74e-49a4-8729-19a6533fe886_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style>
..hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt=3B
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class=3D'hmmessage'>
Hi =3BFellows<BR>
 =3B<BR>
I still have problem to access my databank.It shows syntax problem=2CI am
u=
sing VC++ 2005 with postgresql 8.3.My table name is Person and it has
three=
column=2CPerson ID=2Cfirst name and last name (testing version).whole c++
=
code is <BR>
 =3B<BR>
 =3B<BR>
// Test_postgres.cpp : Defines the entry point for the console
application.=
<BR>
//<BR>
#include "stdafx.h"<BR>
#include "libpq-fe.h"<BR>
 =3B<BR>
 =3B<BR>
int _tmain(int argc=2C _TCHAR* argv[])<BR>
{<BR>
const char *conninfo=3B<BR>
PGconn *conn=3B<BR>
const char *paramtext =3D "server_version"=3B<BR>
PGresult *res=3B<BR>
conninfo =3D "hostaddr =3D 127.0.0.1 dbname =3D Salman_db user =3D
postgres=
password =3D 732047"=3B<BR>
conn =3D PQconnectdb(conninfo)=3B<BR>
if (PQstatus(conn) !=3D CONNECTION_OK)<BR>
{<BR>
printf("Unable to establish connection: %s"=2C<BR>
PQerrorMessage(conn))=3B<BR>
return 1=3B<BR>
} else<BR>
{<BR>
 =3B<BR>
res =3D PQexec(conn=2C "INSERT INTO public.Person VALUES (221=2C'Siddiqi'=
=2C'Umer')")=3B<BR>
if (PQresultStatus(res) !=3D PGRES_COMMAND_OK)<BR>
{<BR>
printf("Problem with command: %s\n"=2C PQerrorMessage(conn))=3B<BR>
PQclear(res)=3B<BR>
PQfinish(conn)=3B<BR>
return 1=3B<BR>
}<BR>
PQclear(res)=3B<BR>
}<BR>
PQfinish(conn)=3B<BR>
<BR>
return 0=3B<BR>
}<BR>
 =3B<BR>
It shows no relation between public and person=2Cif i write only person
=2C=
it show =2CPerson doesn't exist.<BR>
 =3B<BR>
hope=2C u ppl can help me.<BR>
 =3B<BR>
Sheikh Salman Ahmed<BR>Diplomand in =3BNano Struktur
Technologie<BR>Dui=
sburg-Essen Universit=E4t<BR>Mobile : 0049-179-9463738<BR>Home
:0049-203-39=
45028<BR><BR><BR><br /><hr />Invite your mail contacts to join your
friends=
list with Windows Live Spaces. It's easy! <a
href=3D'http://spaces.live.co=
m/spacesapi.aspx?wx_action=3Dcreate&wx_url=3D/friends.aspx&mkt=3Den-us'
tar=
get=3D'_new'>Try it!</a></body>
</html>=
--_434befaa-b74e-49a4-8729-19a6533fe886_--