From: | Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp> |
---|---|
To: | Mike Toews <mwtoews(at)gmail(dot)com> |
Cc: | pgsql-odbc(at)postgresql(dot)org |
Subject: | Re: Connection Timeout |
Date: | 2010-06-03 15:55:47 |
Message-ID: | 4C07D083.8010605@tpf.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
Mike Toews wrote:
> On 3 June 2010 02:01, Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp
> <mailto:inoue(at)tpf(dot)co(dot)jp>> wrote:
>
>
> What kind of tool(e.g. ADO, ADO.NET <http://ADO.NET> on Windows) are
> you using?
>
> regards,
> Hiroshi Inoue
>
>
> I'm using the PostgreSQL Unicode ODBC driver with Python (pyodbc) and
> VBA (ADO). I get the same 18 second timeout with both, regardless of
> what I provide in the connection string. In VBA, there is a
> ConnectionTimeout property, but it does not seem to have any influence,
> e.g.:
>
> ' With added reference Microsoft ActiveX Data Objects 2.x Library
> Sub test()
> Dim Conn As New ADODB.Connection
> Dim ConnStr as String
> ConnStr = "Driver={PostgreSQL
> Unicode};Server=123.4.5.6;Port=5432;Database=mydb;Uid=myid;Pwd=mypw;Timeout=5"
> Conn.CommandTimeout = 5
Please set the ConnectionTimeout preperty not the CommandTimeout one.
It seems to work here.
> Conn.ConnectionString = ConnStr
> Conn.Open
> Debug.Print "connected"
> Conn.Close
> Set Conn = Nothing
> End Sub
>
> It takes 15 seconds to throw an error at "Conn.Open, since the host is
> invalid.
>
> pyodbc has a Connection.timeout property, but it is for query timeout.
>
> -Mike
From | Date | Subject | |
---|---|---|---|
Next Message | Mike Toews | 2010-06-03 17:02:33 | Re: Connection Timeout |
Previous Message | Mike Toews | 2010-06-03 14:53:29 | Re: Connection Timeout |