# Ubuntu ODBC connection issue - Connection::SQLConnectW: \[Dremio\]\[ODBC\] (11560) Unable to locate SQLGetPrivateProfileString function

**URL:** https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891
**Category:** Uncategorized
**Created:** [March 19, 2018, 11:52pm UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891 "2018-03-19T23:52:25Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![WBEVAN](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/wbevan/32/702_2.png) [@WBEVAN](https://community.dremio.com/u/WBEVAN)
#### Post date: [March 19, 2018, 11:52pm UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891/1 "2018-03-19T23:52:26Z")

</div>

Hi,

I am running Ubuntu 16.0.4 and have used Alien to convert the rpm into a deb and performed the installation, which appears to have worked. It updated the odbc ini files with the default information, which I have modified to point to the remote Dremio server. At the moment I am encountering the following issue. When running isql -v dsnname

Mar 19 23:45:05.177 TRACE 3411539776 DRDriver::DRDriver: +++++ enter +++++  
Mar 19 23:45:05.188 DEBUG 3411539776 DSProductHelper::LogProductInfo: Vendor name: Dremio  
Mar 19 23:45:05.198 DEBUG 3411539776 DSProductHelper::LogProductInfo: Driver name: Dremio Connector  
Mar 19 23:45:05.208 DEBUG 3411539776 DSProductHelper::LogProductInfo: Driver version: 1.3.14.1043  
Mar 19 23:45:05.218 DEBUG 3411539776 DSProductHelper::LogProductInfo: Driver is read-write  
Mar 19 23:45:05.228 DEBUG 3411539776 DSProductHelper::LogProductInfo: Unknown loaded this 64-bit driver  
Mar 19 23:45:05.239 INFO 3411539776 Driver::LogVersions: SDK Version: 09.05.19.1030  
Mar 19 23:45:05.249 INFO 3411539776 Driver::LogVersions: DSII Version: 1.3.14.1043  
Mar 19 23:45:05.259 INFO 3411539776 Driver::Initialize: Database CHAR Encoding: UTF-8  
Mar 19 23:45:05.269 INFO 3411539776 Driver::Initialize: Database WCHAR Encoding: UTF-8  
Mar 19 23:45:05.279 INFO 3411539776 Driver::Initialize: ANSI CHAR Encoding: US-ASCII  
Mar 19 23:45:05.289 INFO 3411539776 Driver::Initialize: Driver Manager WCHAR Encoding: UTF-16LE  
Mar 19 23:45:05.299 INFO 3411539776 Driver::Initialize: Detected Driver Manager: unixODBC, 2.2.14 or 2.3.x branch  
Mar 19 23:45:05.309 INFO 3411539776 Driver::Initialize: Locale name: en\_US\_POSIX  
Mar 19 23:45:05.319 INFO 3411539776 Driver::Initialize: Bitness: 64-bit  
Mar 19 23:45:05.329 TRACE 3411539776 CInterface::SQLAllocHandle: +++++ enter +++++  
Mar 19 23:45:05.340 INFO 3411539776 CInterface::SQLAllocHandle: Allocating environment handle.  
Mar 19 23:45:05.350 TRACE 3411539776 Driver::CreateEnvironment: +++++ enter +++++  
Mar 19 23:45:05.360 TRACE 3411539776 DRDriver::CreateEnvironment: +++++ enter +++++  
Mar 19 23:45:05.370 TRACE 3411539776 DREnvironment::DREnvironment: +++++ enter +++++  
Mar 19 23:45:05.381 TRACE 3411539776 Driver::RegisterEnvironment: +++++ enter +++++  
Mar 19 23:45:05.391 TRACE 3411539776 CInterface::SQLSetEnvAttr: +++++ enter +++++  
Mar 19 23:45:05.401 TRACE 3411539776 Driver::GetEnvironment: +++++ enter +++++  
Mar 19 23:45:05.411 TRACE 3411539776 Environment::SQLSetEnvAttr: +++++ enter +++++  
Mar 19 23:45:05.421 INFO 3411539776 Environment::SQLSetEnvAttr: Attribute: SQL\_ATTR\_ODBC\_VERSION (200)  
Mar 19 23:45:05.431 TRACE 3411539776 EnvironmentState1Allocated::SQLSetEnvAttr: +++++ enter +++++  
Mar 19 23:45:05.441 TRACE 3411539776 EnvironmentAttributes::SetAttribute: +++++ enter +++++  
Mar 19 23:45:05.452 INFO 3411539776 EnvironmentAttributes::SetAttribute: Setting ODBC version to: 2  
Mar 19 23:45:05.462 TRACE 3411539776 CInterface::SQLGetEnvAttr: +++++ enter +++++  
Mar 19 23:45:05.472 TRACE 3411539776 Driver::GetEnvironment: +++++ enter +++++  
Mar 19 23:45:05.482 TRACE 3411539776 Environment::SQLGetEnvAttr: +++++ enter +++++  
Mar 19 23:45:05.492 INFO 3411539776 Environment::SQLGetEnvAttr: Attribute: SQL\_ATTR\_ODBC\_VERSION (200)  
Mar 19 23:45:05.502 TRACE 3411539776 EnvironmentState::SQLGetEnvAttr: +++++ enter +++++  
Mar 19 23:45:05.512 TRACE 3411539776 CInterface::SQLAllocHandle: +++++ enter +++++  
Mar 19 23:45:05.522 INFO 3411539776 CInterface::SQLAllocHandle: Allocating connection handle.  
Mar 19 23:45:05.532 TRACE 3411539776 Driver::GetEnvironment: +++++ enter +++++  
Mar 19 23:45:05.542 TRACE 3411539776 Environment::SQLAllocHandle: +++++ enter +++++  
Mar 19 23:45:05.552 TRACE 3411539776 EnvironmentState1Allocated::SQLAllocHandle: +++++ enter +++++  
Mar 19 23:45:05.562 TRACE 3411539776 DREnvironment::CreateConnection: +++++ enter +++++  
Mar 19 23:45:05.572 TRACE 3411539776 DSLockableConnection::DSLockableConnection: +++++ enter +++++  
Mar 19 23:45:05.582 TRACE 3411539776 DSLockableConnection::InitializeDriverLocking: +++++ enter +++++  
Mar 19 23:45:05.592 TRACE 3411539776 DRConnection::DRConnection: +++++ enter +++++  
Mar 19 23:45:05.602 TRACE 3411539776 Driver::RegisterConnection: +++++ enter +++++  
Mar 19 23:45:05.612 TRACE 3411539776 CInterface::SQLConnect: +++++ enter +++++  
Mar 19 23:45:05.622 TRACE 3411539776 Connection::SQLConnectW: +++++ enter +++++  
Mar 19 23:45:05.632 TRACE 3411539776 ConnectionState2::SQLConnectW: +++++ enter +++++  
Mar 19 23:45:05.651 ERROR 3411539776 Connection::SQLConnectW: [Dremio][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.  
Mar 19 23:45:05.661 TRACE 3411539776 CInterface::SQLGetDiagRec: +++++ enter +++++  
Mar 19 23:45:05.671 TRACE 3411539776 CInterface::SQLGetDiagRec: +++++ enter +++++  
Mar 19 23:45:05.682 TRACE 3411539776 CInterface::SQLFreeHandle: +++++ enter +++++  
Mar 19 23:45:05.692 INFO 3411539776 CInterface::SQLFreeHandle: Freeing connection handle.  
Mar 19 23:45:05.702 TRACE 3411539776 Environment::SQLFreeHandle: +++++ enter +++++  
Mar 19 23:45:05.712 TRACE 3411539776 DSLockableConnection::~DSLockableConnection: +++++ enter +++++  
Mar 19 23:45:05.722 TRACE 3411539776 Driver::UnregisterConnection: +++++ enter +++++  
Mar 19 23:45:05.732 TRACE 3411539776 CInterface::SQLFreeHandle: +++++ enter +++++  
Mar 19 23:45:05.742 INFO 3411539776 CInterface::SQLFreeHandle: Freeing environment handle.  
Mar 19 23:45:05.752 TRACE 3411539776 Driver::FreeEnvironment: +++++ enter +++++  
Mar 19 23:45:05.762 TRACE 3411539776 Driver::GetEnvironment: +++++ enter +++++  
Mar 19 23:45:05.773 TRACE 3411539776 Driver::UnregisterEnvironment: +++++ enter +++++  
[S1000][unixODBC][Dremio][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.  
[ISQL]ERROR: Could not SQLConnect

Does anyone have any idea on the what the error is relating to ? So I can troubleshoot further

Thanks

Wayne

---

<div class="post-metadata">

### Author: ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)
#### Post date: [March 20, 2018, 12:18am UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891/2 "2018-03-20T00:18:06Z")

</div>

It’s an issue between the Dremio ODBC driver and the ODBC Driver Manager (unixODBC). Here are multiple ways of solving the issue:

- install `unixodbc-dev`
- in the driver configuration file `dremio.drillodbc.ini`, add the following line `ODBCInstLib=libodbcinst.so.2` under the `[Driver]` section.

At the same time, we are working on a resolution, and will publish a new driver as soon as the issue is fixed.

---

<div class="post-metadata">

### Author: ![WBEVAN](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/wbevan/32/702_2.png) [@WBEVAN](https://community.dremio.com/u/WBEVAN)
#### Post date: [March 20, 2018, 12:30am UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891/3 "2018-03-20T00:30:33Z")

</div>

Perfect the unixodbc-dev just did the trick on its own with no need to modify the dremio.drillodbc.ini at least for my installation anyway. BTW Thanks for such a great product

---

<div class="post-metadata">

### Author: ![akshaygaur](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/akshaygaur/32/762_2.png) [@akshaygaur](https://community.dremio.com/u/akshaygaur)
#### Post date: [June 29, 2018, 1:54pm UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891/4 "2018-06-29T13:54:36Z")

</div>

Could you tell me what settings do you have in your odbc config files? I am unable to connect and it tells me “Data source name not found”.

I am just so confused as to what needs to go where with regards to the /etc/odbc.ini and /etc/odbcinst.ini files.

No matter what I put in these files, I always get Data source name not found.

Any help is much appreciated.

---

<div class="post-metadata">

### Author: ![akshaygaur](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/akshaygaur/32/762_2.png) [@akshaygaur](https://community.dremio.com/u/akshaygaur)
#### Post date: [June 29, 2018, 1:59pm UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891/5 "2018-06-29T13:59:14Z")

</div>

Right now, my config settings are:  
cat odbc.ini  
[Dremio]  
Description=Dremio  
Driver=/opt/dremio-odbc/lib64/libdrillodbc\_sb64.so  
ConnectionType=Direct  
HOST=localhost  
PORT=31010  
ZKQuorum=[Zookeeper Quorum]  
ZKClusterID=[Cluster ID]  
AuthenticationType=Plain  
UID=[USERNAME]  
PWD=[PASSWORD]  
DelegationUID=  
KrbServiceName=dremio  
KrbServiceHost=  
AdvancedProperties=CastAnyToVarchar=true;HandshakeTimeout=5;QueryTimeout=180;TimestampTZDisplayTimezone=utc;NumberOfPrefetchBuffers=5;  
Catalog=DREMIO  
Schema=

cat odbcinst.ini  
[Dremio]  
Description=Dremio  
Driver=/opt/dremio-odbc/lib64/libdrillodbc\_sb64.so  
UsageCount=1

---

<div class="post-metadata">

### Author: ![jduong](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/jduong/32/21_2.png) [@jduong](https://community.dremio.com/u/jduong)
#### Post date: [June 29, 2018, 3:58pm UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891/6 "2018-06-29T15:58:30Z")

</div>

Hi @akshaygaur

What program are you using to run the ODBC driver?

At the top of the odbc.ini file you should add the following:  
[ODBC Data Sources]  
Dremio=Dremio

The odbc.ini file can either go in /etc/odbc.ini or $HOME/.odbc.ini (note the preceding period). Same with the odbcinist.ini file.

---

<div class="post-metadata">

### Author: ![akshaygaur](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/akshaygaur/32/762_2.png) [@akshaygaur](https://community.dremio.com/u/akshaygaur)
#### Post date: [June 29, 2018, 4:52pm UTC](https://community.dremio.com/t/ubuntu-odbc-connection-issue-connection-sqlconnectw-dremio-odbc-11560-unable-to-locate-sqlgetprivateprofilestring-function/891/7 "2018-06-29T16:52:54Z")

</div>

@jduong - I am using python to try to access (using pyodbc) Dremio.

Earlier config files had a driver name  
`Dremio ODBC Driver 64-bit`  
in odbcinst.ini and  
`Dremio ODBC 64-bit`  
in odbc.ini

so I was having trouble connecting no matter what name I used. So I changed them all to one value and I guess that is what fixed the issue.

I started by checking where the exact issue was by issuing the following command in terminal:  
`isql -v Dremio <username> <password>`  
and i was able to connect successfully.  
So I checked my python connect string where I was using:  
`cnxn = pyodbc.connect("DSN={Dremio};UID=akshaygaur;PWD=password", autocommit=True)`  
and changed it to:  
`cnxn = pyodbc.connect("DSN=Dremio;UID=akshaygaur;PWD=password", autocommit=True)`

and it worked. I don’t know why curly brackets were causing the issue though.

Also, I didn’t need:  
`[ODBC Data Sources]`  
`Dremio=Dremio`

at the top of my odbc.ini file for whatever reason.

Appreciate your response!
