pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Combs <rncombs@covad.net>
To: pgsql-odbc@postgresql.org
Subject: Re: Delphi7, ADO, ODBC and PostgreSQL connection problems
Date: Wed, 17 Sep 2003 21:52:24 -0500
Message-ID: <3F691DE8.70703@covad.net> (raw)

I have been able to successfully connect to PostgreSQL using D7 and ADO.
Environment:
    D7 on W2K workstation
    MDAC v2.8
    PostgreSQL ODBC driver v7.03.01.00
    PostgeSQL v7.3.4 on SuSE Linux 8.2
         (Compiled with odbc switch, odbc.sql applied to template1
before creating new databse)

With ODBC
    Create system DSN pointing to databse on server
         (use standard driver)
In D7
    New project
         Add ADOConnection
               Build Connection String (using the system DSN you just
created)
               - Mine looks like this:
                     Provider=MSDASQL.1;Password=sysdba;Persist
Security Info=True;
                     User ID=postgres;Data Source=Manpower-pg;
                     Extended
Properties="DSN=Manpower-pg;DATABASE=manpower;
                      SERVER=192.168.0.3;PORT=5432;
                      UID=postgres;PWD=sysdba;ReadOnly=0;

Protocol=6.4;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=1;
                      ShowSystemTables=0;ConnSettings=;Fetch=100;
                      Socket=4096;UnknownSizes=2;MaxVarcharSize=254;
                      MaxLongVarcharSize=32764;Debug=0;CommLog=0;
                      Optimizer=1;Ksqo=1;UseDeclareFetch=1;
                      TextAsLongVarchar=1;UnknownsAsLongVarchar=1;
                      BoolsAsChar=1;Parse=1;CancelAsFreeStmt=0;
                      ExtraSysTablePrefixes=dd_;;LFConversion=1;

UpdatableCursors=1;DisallowPremature=1;TrueIsMinus1=0;
                      BI=0;ByteaAsLongVarBinary=0;UseServerSidePrepare=1"
              Test the connection after building it - it should test ok
              Set the connection to active - you should have a valid
connection
         Add some other stuff to the form to verify you are getting data
              In my case, I added an ADOTable, DataSource, and DataGrid
                   (grid points to source, source to table, table to
connection)
              You can view the full table contents.

Some other things to check:
    1. Check your pg_hba.conf - are you allowing access to your client
machine?
    2. Check your postgresql.conf - do you allow tcpip_sockets,
         have you changed your default port from 5432?
    3. Do you have proper rights to the database - are you logging in
with the
        same user name and password as you used to create the database?

You can always try using dbExpress using the openODBC driver available
on sourceforge.
However, I have had problems getting all rows of a table to return.
Only the first row
shows up.  Checking logs and packet sniffing reveals PostgreSQL is
returning all rows.

IMHO dbExpress is not yet ready for primetime - it is too quirky.  Too
bad as I would like
to use it in place of ADO.

HTH







view thread (17+ messages)  latest in thread

Message-ID: <3F691DE8.70703@covad.net>
Permalink:  ../3F691DE8.70703@covad.net/
Also on:    postgresql.org/message-id/3F691DE8.70703@covad.net

 · 

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: rncombs@covad.net
  Subject: Re: Delphi7, ADO, ODBC and PostgreSQL connection problems
  In-Reply-To: <3F691DE8.70703@covad.net>
  References: <3F691DE8.70703@covad.net>

* 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