title: Postgresql libpq with Qt in windows
body: <p>I am trying to connect to a remote postgresql database from qt using libpq.lib.  I have a postgresql installation on my machine and I have installed the ODBC drivers.  I use the database with java/jdbc.  In my Qt work All I can seem to do is get my application to crash unexpectedly and I can't seem to make any progress.</p>
  
  <p>My connection code is</p>
  
  <pre><code>PGconn * connection;
  char       conninfo[250];
  
  sprintf(conninfo, "user=%s password=%s dbname=%s hostaddr=%s port=%d", "user", "password", "foo", "192.168.3.3", 5433);
  qDebug() &lt;&lt; "Foo1: " &lt;&lt; conninfo;
  
  connection = PQconnectdb( conninfo );
  qDebug() &lt;&lt; "Foo1: ";
  </code></pre>
  
  <p>Any guidance will be appreciated.</p>