-
Notifications
You must be signed in to change notification settings - Fork 10
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
DSN is not resolved when called from Excel #58
Comments
Thanks for the screenshots, I am able to reproduce this in Excel 2016. Moving to the new issue, because it looks to be specific to Excel/Query Editor.
|
In my environment it appeared to be caused by the credentials that are being appended to the ODBC connection string by Excel. When credentials are included - this confuses the DuckDB ODBC driver and it cannot find the DSN: >>> import pyodbc
>>> print(pyodbc.connect("DSN=user_test_3;").cursor().execute("select current_catalog()").fetchone())
('test3',)
>>> print(pyodbc.connect("DSN=user_test_3;UID=foo;PWD=bar;").cursor().execute("select current_catalog()").fetchone())
('memory',) This needs to be fixed in the DuckDB ODBC Driver, meanwhile the workaround for Excel is to delete the default credentials for DuckDB DSNs: After that, when new Query Editor is being opened, it is necessary to choose "Default or Custom" instead of "Database" in the corresponding dialog: |
Thanks. This "workaround" works around for me. |
When the ODBC data source is used from Excel/Power Query, additional options may be added to connection string automatically without showing them to user. It was discovered in duckdb#58 that `UID` and `PWD` options are added when user has credentials registered for this DSN in Excel. DuckDB driver does not recognize these options and currently cannot process them properly (see duckdb#59 for details). However the driver knows about possible `trusted_connection` Excel/Power Query option and ignores it successfully. It is proposed to also add `UID` and `PWD` to the existing ignore list. In the light of duckdb#60, that fixes the handling for unsupported options, this change is not strictly necessary, but it still may be better to consistently ignore all unneeded Excel/Power Query options and to not register diagnostic messages for them. Testing: existing Excel/Power Query ignore list test is extended to include new options. Fixes: duckdb#58
When the ODBC data source is used from Excel/Power Query, additional options may be added to connection string automatically without showing them to user. It was discovered in duckdb#58 that `UID` and `PWD` options are added when user has credentials registered for this DSN in Excel. DuckDB driver does not recognize these options and currently cannot process them properly (see duckdb#59 for details). However the driver knows about possible `trusted_connection` Excel/Power Query option and ignores it successfully. It is proposed to also add `UID` and `PWD` to the existing ignore list. In the light of duckdb#60, that fixes the handling for unsupported options, this change is not strictly necessary, but it still may be better to consistently ignore all unneeded Excel/Power Query options and to not register diagnostic messages for them. Testing: existing Excel/Power Query ignore list test is extended to include new options. Fixes: duckdb#58
Originally posted by @malcook in #29
The text was updated successfully, but these errors were encountered: