QGIS
QGIS copied to clipboard
MSSQL password is not prompted if pw Save is unchecked
Describe the bug The problem is if I don't check Save Password in the Create a New MSSQL connection dialog (what you get after hitting New or Edit in the Data Source Manager / MSSQL dialog) in QGIS when setting up a connection then QGIS loses the password as soon as the window is closed. The following connection attempts fail. If Save password is checked, everything works as expected.
How to Reproduce Prerequisites: Credentials for MSSQL Server
- Start QGIS – New Empty Project
- Open Data Source Manager – click Add MSSQL Layer
- Under connections click New
- Enter Connection Name, Host, Username and Password
- Check Save Username
- Uncheck Save Password
- Click List Databases --> perfect, your database is now listed
- Click OK to close window "Create a New MSSQL Connection"
- In "Data Source Manager" window click Connect
Actual Result Error MSSQL Provider [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. [Microsoft][ODBC Driver Manager] Fehler bei SQLSetConnectAttr-Aufruf für Treiber QODBC3: Unable to connect
Expected Result A password prompt and then a list of available MSSQL Tables
QGIS and OS versions
QGIS version | 3.16.1-Hannover | QGIS code revision | b381a90dca |
---|---|---|---|
Compiled against Qt | 5.11.2 | Running against Qt | 5.11.2 |
Compiled against GDAL/OGR | 3.1.4 | Running against GDAL/OGR | 3.1.4 |
Compiled against GEOS | 3.8.1-CAPI-1.13.3 | Running against GEOS | 3.8.1-CAPI-1.13.3 |
Compiled against SQLite | 3.29.0 | Running against SQLite | 3.29.0 |
PostgreSQL Client Version | 11.5 | SpatiaLite Version | 4.3.0 |
QWT Version | 6.1.3 | QScintilla2 Version | 2.10.8 |
Compiled against PROJ | 6.3.2 | Running against PROJ | Rel. 6.3.2, May 1st, 2020 |
OS Version | Windows 10 (10.0) | ||
Active python plugins | QuickOSM; quick_map_services; db_manager; MetaSearch; processing |
Additional context
@robhubi Hello, is this issue still valid on recent releases?
Hi Pedro-Murteira, The current LTR version QGIS 3.22.6-Białowieża, code rev. b6f33b1a behaves a bit differently, so after "Connect" the objects of the database are listed, but always remain greyed out with type "Detecting...". After clicking on "Also list tables with no geometry" the above error occurs.
So yes, the current QGIS version shows the same issue.
Hi, We have the same issue. The only way to use a MSSQL connection in QGIS in a user-friendly way is by saving the password as plain text, which is not safe. Is there a way to provide the same functionalities (the password prompt) as the postgres connection has for the mssql connection?
We 're using qgis 3.28.12
Or is there an option to use the pasword manager in the MSSQL Connection?