C application to PostgreSQL in Windows - Mailing list pgsql-odbc

From Stanley Wang
Subject C application to PostgreSQL in Windows
Date
Msg-id 20060824155644.50369.qmail@web51009.mail.yahoo.com
Whole thread Raw
List pgsql-odbc
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

pgsql-odbc by date:

Previous
From:
Date:
Subject: [ psqlodbc-Bugs-1000709 ] SQLForeignKeys missing FK_NAME missing PK_NAME
Next
From:
Date:
Subject: [ psqlodbc-Bugs-1000417 ] odbc_lib_connect() returns "Specified driver could not be loaded due to system error 182 (PostgreSQL ANSI)"