Hi Wei Wei,
How is your issue going? Has it been resolved yet? If it has, please consider accepting the answer as it helps others sharing the same problem benefit too. Thank you :)
VP
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to set up a series of ODBC connections for SQL Server across several hundred Windows machines on our corporate network, but the main issue is that they all require pre-saved login credentials. Setting up the connection without credentials is easy, but I cannot find a supported way to include usernames and passwords; scripts and registry changes are falling short. This is becoming a major headache as we are preparing a company-wide application rollout, and users are constantly being hit with login prompts. Is there a workaround or a proper solution for this?
Hi Wei Wei,
Your previous attempts to inject credentials using scripts and registry modifications are failing because of a deliberate security architecture within the Windows ODBC Data Source Administrator. When you deploy a System or User DSN, the ODBC driver manager intentionally drops the password attribute before writing the connection string to the registry path at HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI. This behavior is by design to prevent plain-text database credentials from being exposed to malicious software or unauthorized users browsing the registry. Because of this restriction, there is no supported or secure method to permanently bake SQL Authentication passwords directly into a deployed DSN.
To resolve the login prompts for your users while maintaining strict security compliance, you must transition your ODBC deployment to Windows Integrated Authentication. This approach leverages your existing Active Directory infrastructure, allowing the ODBC driver to automatically pass the currently logged-in Windows user's token directly to the SQL Server. You can implement this by adjusting your deployment scripts to create a string value named Trusted_Connection and setting its data to Yes within your specific DSN registry key, while completely omitting the user ID and password fields. Once your database administrators map the appropriate Active Directory security groups to the required SQL Server roles, your users will authenticate silently in the background when launching the application.
Hope this answer brought you some useful information. If it did, please hit “accept answer”. Should you have any questions, feel free to leave a comment.
VP
AI answer
There is no supported, secure way to mass‑deploy ODBC DSNs with embedded SQL usernames and passwords on Windows. The platform and drivers are designed specifically to avoid storing credentials in connection strings or DSN definitions for security reasons.
Key points from the documentation and related guidance:
Trusted_Connection=Yes or equivalent, and in DSN configuration via “With Integrated Windows Authentication” or “Windows Integrated” authentication mode.SQLDriverConnect.Given these constraints, the proper solution for a company‑wide rollout is to redesign authentication so that:
References: