pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stanley Wang <stan_w99@yahoo.com>
To: pgsql-odbc@postgresql.org
Subject: C application to PostgreSQL in Windows
Date: Thu, 24 Aug 2006 08:56:43 -0700 (PDT)
Message-ID: <20060824155644.50369.qmail@web51009.mail.yahoo.com> (raw)

Hi, 

I am a newbie to PostgreSQL. I want to write a C
application to retrieve data from PostgreSQL. I have
installed the PostgreSQL v8.1 for Windows and write a
simple test application. I also downloaded and
installed the ODBC driver. The application compiles
OK, but when I run it, it crashes. The problematic
code is to connect to the database. 

PGconn     *conn;
conn = PQconnectdb("user=postgres password=stan
dbname=postgis hostaddr=127.0.0.1 port=5432");        
     

The DSN I created is like following:

Data Source : PostgreSQL Unicode
Database : postgis
Server : 127.0.0.1
Username : postgres
Password : stan
Port : 5432

I wonder whether it is the correct way to set up
everything. Thanks in advance for your answer.

Stan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



Message-ID: <20060824155644.50369.qmail@web51009.mail.yahoo.com>
Permalink:  ../20060824155644.50369.qmail@web51009.mail.yahoo.com/
Also on:    postgresql.org/message-id/20060824155644.50369.qmail@web51009.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: stan_w99@yahoo.com
  Subject: Re: C application to PostgreSQL in Windows
  In-Reply-To: <20060824155644.50369.qmail@web51009.mail.yahoo.com>
  References: <20060824155644.50369.qmail@web51009.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox