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

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Ivan Zhang <w(dot)s(dot)zhang(at)motorolasolutions(dot)com>, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: [issue?] SQLDriverConnect will clear existing connect attribute setting.
Date: 2015-01-15 08:53:03
Message-ID: 54B77FEF.4080201@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 01/04/2015 08:11 AM, Ivan Zhang wrote:
> 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).

It's a bug. It should be possible to set SQL_ATTR_AUTOCOMMIT before
establishing connection.

Fixed, thanks for the report!

- Heikki

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Heikki Linnakangas 2015-01-15 10:52:58 Re: SQL_CURSOR_TYPE prepare execute issue
Previous Message Faith, Jeremy 2015-01-14 16:56:18 Re: SQL_CURSOR_TYPE prepare execute issue