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

Поиск
Список
Период
Сортировка
Искать
От
Heikki Linnakangas
Тема
Re: [issue?] SQLDriverConnect will clear existing connect attribute setting.
Дата
Msg-id
54B77FEF.4080201@vmware.com
Ответ на
Список
Дерево обсуждения
[issue?] SQLDriverConnect will clear existing connect attribute setting. Ivan Zhang <w.s.zhang@motorolasolutions.com>
Re: [issue?] SQLDriverConnect will clear existing connect attribute setting. Heikki Linnakangas <hlinnakangas@vmware.com>
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


В списке pgsql-odbc по дате отправления
От: Faith, Jeremy
Дата:
От: Heikki Linnakangas
Дата:
FAQ