ODBC Registry settings are not reflected in UI - ODBC Database administrator(32-bit)

Kumar, Saravana 21 Reputation points
2021-12-07T03:21:33.897+00:00

I am using Windows Server 2019 version 1809 OS Build 17763.1158. I want to enable encryption for ODBC DSN connection So I am calling this command "C:\Windows\SysWOW64\odbcconf.exe /A {CONFIGSYSDSN "ODBC Driver 17 for SQL Server" "DSN=MyDataSource|Server=%ServerName%|Encrypt=yes|TrustServerCertificate=yes"}" from the script file (.bat file).

Registry settings are updated properly under "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ODBC\ODBC.INI\MYDatasource" but when I launch ODBC Databse administrator(32-bit) and slected my datasource clicked on configure -> Next -> Next->Next check "Use string encryption for Data" and "Trust server certificate" checkbox remains unchecked though registry settings has "YES".

155502-odbc-reg-settings-not-refelected-in-ui.png

SQL Server | Other
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,586 Reputation points
    2021-12-16T07:46:33.73+00:00

    Hi @Kumar, Saravana ,

    Please see this link:
    https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax#windows-authentication

    We recommend using Windows Authentication (sometimes referred to as integrated security) to connect to data sources that support it.

    So this is why I want you to add Trusted_Connection=Yes.
    According to your script, the SQL authentication method is created by default. And I also did a test. You can check whether the SQL authentication method is selected by default in the configuration window after running your script.
    158145-1.png
    And in this case, the changes you make will also fail when you test the connection. So the registry will not be changed.
    158057-2.png

    then If I execute the script , UI checkbox enable\disable started working based on script values.

    So I suggest to choose the windows authentication mode, that is, use the command I posted before.

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it.


2 additional answers

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,586 Reputation points
    2021-12-07T09:24:11.56+00:00

    Hi @Kumar, Saravana ,

    Welcome to Microsoft Q&A!
    Please see this document about these two options:
    https://learn.microsoft.com/en-us/sql/connect/odbc/windows/dsn-wizard-4?view=sql-server-ver15

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Seeya Xi-MSFT 16,586 Reputation points
    2021-12-08T08:26:15.47+00:00

    Hi @Kumar, Saravana ,

    In addition, you need to note that if you use the ODBC manager to modify the DSN configuration, you need to test whether the connection is successful before clicking OK.
    155921-1.png
    If the connection fails, please change Trusted_Connection to Yes if you are Windows login.
    155770-2.png
    Please see this link: https://learn.microsoft.com/en-us/sql/relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client?view=sql-server-ver15
    See part from the link:
    155894-3.png

    The above content is based on the command you gave, assuming you are the windows login way. If I misunderstood what you mean, please feel free to let me know.
    Finally, good day for you.

    Best regards,
    Seeya


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.