I take data from PostgreSQL via ODBC and put the data in excel worksheet. For this I use VBA which makes a query table. In the VBA script I specify a connection string which contains some ODBC settings

ConnectionString = "ODBC;DSN=PostgreSQL30;DATABASE=xxxxx;SERVER=xxx.xxx.xxx.xxx;PORT=5432;UID=xxx;;SSLmode=disable;ReadOnly=0;Protocol=7.4;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=0;ShowSystemTables=0;ConnSettings=;Fetch=100;Socket=4096;UnknownSizes=0;MaxVarcharSize=255;MaxLongVarcharSize=8190;Debug=0;CommLog=0;Optimizer=0;Ksqo=0;UseDeclareFetch=1;TextAsLongVarchar=1;UnknownsAsLongVarchar=0;BoolsAsChar=1;Parse=1;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;;LFConversion=1;UpdatableCursors=1;DisallowPremature=0;TrueIsMinus1=0;BI=0;ByteaAsLongVarBinary=0;UseServerSidePrepare=1;LowerCaseIdentifier=0;GssAuthUseGSS=0;XaOpt=1"

For this ODBC connection there are settings in Windows 7 which are in ODBC Data Source Administrator > User DNS > PostgreSQL30 > Configure... > Datasource. This is the window

enter image description here

Which ODBC connection properties have higher priority - defined in windows setting or defined with a connection string?


Typically, attributes set in an ODBC connect string will override attributes set in a DSN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.