[issue?] SQLDriverConnect will clear existing connect attribute setting. - Mailing list pgsql-odbc

From Ivan Zhang
Subject [issue?] SQLDriverConnect will clear existing connect attribute setting.
Date
Msg-id BY1PR0401MB143087AD121D0251C00E5045A85B0@BY1PR0401MB1430.namprd04.prod.outlook.com
Whole thread Raw
Responses Re: [issue?] SQLDriverConnect will clear existing connect attribute setting.  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List 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

pgsql-odbc by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Moving psqlodbc from pgfoundry to github
Next
From: Witold Knapek
Date:
Subject: PostgreSQL ODBC Driver ver. 09.03.0400