-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLGetPrivateProfileString() failing to recognize system DSN #103
Comments
Do you use the SQLSetConfigMode call to indicate the use of both system and user DSNs by the driver ? What ODBC Driver Manager is your The directory name |
Hi @HughWilliams. Thanks for the prompt response. Yes we are using iODBC driver manager. Our repo will eventually be public open source but it is private for now so I can't yet share it. However I can point you to another repo which is facing the exact same issue. I did previously try I tried out all three config mode options once again with this new understanding and observed that the default config mode Fortunately this means, at worst, we can call |
Development is working on a solution. |
Just checking in to see if there's been any movement on this? |
In our ODBC driver, we call
SQLGetPrivateProfileString()
to look up connection attributes configured in our DSNs. However, on MacOs using iODBC, this only works with user DSNs. When trying to look up a system DSN, we get nothing back fromSQLGetPrivateProfileString()
.Now the iODBC driver manager can still recognize a system DSN in general even though
SQLGetPrivateProfileString()
is not recognizing it. The reason we know this is because, when providing a bogus DSN, the iODBC driver manager will reject the connection before our driver ever gets toSQLGetPrivateProfileString()
.On my system I have the following system DSN defined at
/Library/ODBC/odbc.ini
:And I have the following user DSN defined at
~/Library/ODBC/odbc.ini
:When looking at the comments in your source code, it appears that the expected precedence order is:
Since the user odbc.ini is ahead of the system odbc.ini in precedence, I thought perhaps the existence of my user odbc.ini is the problem. However I still see the same behavior when temporarily removing the user odbc.ini. I also tried hardcoding the path to my system odbc.ini as an argument to
SQLGetPrivateProfileString()
and I still saw the same behavior.Explicitly setting the
ODBCINI
variable to point at my system odbc.ini does solve the problem. However it's not a great solution as we would still need to update this variable each time we are switching between system and user DSNs. And it also doesn't work when using a GUI application such as iODBC administrator.The text was updated successfully, but these errors were encountered: