X-Original-To: pgsql-odbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 7C32D9FB213 for ; Thu, 24 Aug 2006 12:57:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 33436-03 for ; Thu, 24 Aug 2006 15:56:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web51009.mail.yahoo.com (web51009.mail.yahoo.com [206.190.39.128]) by postgresql.org (Postfix) with SMTP id 75A3B9FA7BA for ; Thu, 24 Aug 2006 12:56:45 -0300 (ADT) Received: (qmail 50371 invoked by uid 60001); 24 Aug 2006 15:56:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=lDXLw0+NXfd5Guce/c7doh0UUZZ5dbnbP0s8nkRMiC879LQH0k4rOOoMXLidB84P6j2ZRn+/N2ESPWEePJp64mMexDXgCOBp8zMOxYA6DOzcYIqBwxff2sbDqJVSY1wGdfKcB+B3wLnzcaYce3J2p+wmBj5mk21fH67vEukS2dE= ; Message-ID: <20060824155644.50369.qmail@web51009.mail.yahoo.com> Received: from [194.171.252.100] by web51009.mail.yahoo.com via HTTP; Thu, 24 Aug 2006 08:56:43 PDT Date: Thu, 24 Aug 2006 08:56:43 -0700 (PDT) From: Stanley Wang Subject: C application to PostgreSQL in Windows To: pgsql-odbc@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.107 tagged_above=0 required=5 tests=FROM_HAS_ULINE_NUMS, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: **** X-Archive-Number: 200608/93 X-Sequence-Number: 8057 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