[issue?] SQLDriverConnect will clear existing connect attribute setting.

From: Ivan Zhang <w(dot)s(dot)zhang(at)motorolasolutions(dot)com>
To: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: [issue?] SQLDriverConnect will clear existing connect attribute setting.
Date: 2015-01-04 06:11:40
Message-ID: BY1PR0401MB143087AD121D0251C00E5045A85B0@BY1PR0401MB1430.namprd04.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

I have a library to connect different database with ODBC. Found it's not work on postgresql by setting autocommit off.

SQLSetConnectAttr(hDbc,
SQL_ATTR_AUTOCOMMIT,
(SQLPOINTER) SQL_AUTOCOMMIT_OFF,
0)

SQLDriverConnect(hDbc,
GetDesktopWindow(),
wszConnStr,
SQL_NTS,
NULL,
0,
NULL,
SQL_DRIVER_COMPLETE);

After checked the source, found that

PGAPI_Connect init the connection attribute/option in CC_conninfo_init.

So I have to set connect Attribute after Connect. Is this expected?

SQLDriverConnect -> SQLSetConnectAttr

It's different with ODBC interface expected(allocate -> set -> connect).

Thanks

Best Regards
Ivan

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Witold Knapek 2015-01-05 10:16:24 PostgreSQL ODBC Driver ver. 09.03.0400
Previous Message Heikki Linnakangas 2014-12-31 13:41:37 Re: Moving psqlodbc from pgfoundry to github