• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

odbcad32.exe in Win 7 Enterprise - adding user SQL server DSN

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    odbcad32.exe in Win 7 Enterprise - adding user SQL server DSN

    I've got a list of about 50 user MS SQL server DSNs to add for an app I'm packaging and the settings in odbcad32.exe need to be set so that the option to "Connect to SQL server to obtain default settings for the additional configuration options" is unticked.

    So i did it for one, exported the reg key and then wrote a script to amend the reg file with a new DSN with respective name/decription/server etc and it all worked fine.

    Then when I import the reg file I notice that the "Connect to SQL server to obtain default settings for the additional configuration options" is ticked.

    I tested it again manually and I can't get that option to stay unticked not even for a single DSN using the wizard.

    I ran it as an admin and still no joy (it's a user DSN anyway...) - any ideas what I need to do to make that option stay unticked?

    This is on a VMware image, logged in as admin using the odbcad32.exe from C:\Windows\SysWOW64 on Win 7 Enterprise edition.
    "Is someone you don't like allowed to say something you don't like? If that is the case then we have free speech."- Elon Musk

    #2
    Originally posted by Jog On View Post
    I've got a list of about 50 user MS SQL server DSNs to add for an app I'm packaging and the settings in odbcad32.exe need to be set so that the option to "Connect to SQL server to obtain default settings for the additional configuration options" is unticked.

    So i did it for one, exported the reg key and then wrote a script to amend the reg file with a new DSN with respective name/decription/server etc and it all worked fine.

    Then when I import the reg file I notice that the "Connect to SQL server to obtain default settings for the additional configuration options" is ticked.

    I tested it again manually and I can't get that option to stay unticked not even for a single DSN using the wizard.

    I ran it as an admin and still no joy (it's a user DSN anyway...) - any ideas what I need to do to make that option stay unticked?

    This is on a VMware image, logged in as admin using the odbcad32.exe from C:\Windows\SysWOW64 on Win 7 Enterprise edition.
    What did the registry file that you exported look like? Can you paste it here please?

    Also, do you have multiple copies of odbcad32.exe in different directories? Do you get the same results with both versions? I had problems once running the "wrong" copy which caused problems setting up ODBC connections. it is a long shot - but if nothing else works .....

    Comment


      #3
      A single entry looks like this:

      Code:
      Windows Registry Editor Version 5.00
      
      [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI]
      
      [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources]
      "Name"="SQL Server"
      
      [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\name]
      "Driver"="C:\\windows\\system32\\SQLSRV32.dll"
      "Description"="Description"
      "Server"="Server_name"
      "UseProcForPrepare"="0"
      "AnsiNPW"="No"
      "Database"="db_nAME"
      "LastUser"="Administrator"
      "Trusted_Connection"="Yes"
      "AutoTranslate"="No"
      I used the one in C:\Windows\SysWOW64 but I'll have a look for another one. Thanks
      "Is someone you don't like allowed to say something you don't like? If that is the case then we have free speech."- Elon Musk

      Comment


        #4
        Originally posted by Jog On View Post
        A single entry looks like this:

        Code:
        Windows Registry Editor Version 5.00
        
        [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI]
        
        [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources]
        "Name"="SQL Server"
        
        [HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\name]
        "Driver"="C:\\windows\\system32\\SQLSRV32.dll"
        "Description"="Description"
        "Server"="Server_name"
        "UseProcForPrepare"="0"
        "AnsiNPW"="No"
        "Database"="db_nAME"
        "LastUser"="Administrator"
        "Trusted_Connection"="Yes"
        "AutoTranslate"="No"
        I used the one in C:\Windows\SysWOW64 but I'll have a look for another one. Thanks
        I am no expert in Sql Server so I may be completely wrong. but in this documentation it states

        In future versions of the SQL Server ODBC driver there may be some additional parameters. All of the parameters have a default value, so it will not affect your current setup. This is why some parameters have no entries in the registry.
        This may mean that the server will default other settings you don't specify. E.g. you haven't used the LANGUAGE parameter so the LANGUAGE will depend on what languages are installed on the server at runtime.

        Certainly there does not seem to be any registry key sounding like "Connect to SQL server to obtain default settings for the additional configuration options". Perhaps ticking this box interactively just queries the current server defaults and writes them away as registry keys. If this is the case, since you are distributing your application, leaving the options blank and getting the run time defaults may be a better option for you anyway.

        p.s. Please don't build an enterprise system solely on the basis of my speculations above!!

        Comment


          #5
          Reg keys aside I've found that it stays ticked even after manually going through the wizard and unticking the box.

          I've given it back to the clientco App owner to do some more 'discovery' on it
          "Is someone you don't like allowed to say something you don't like? If that is the case then we have free speech."- Elon Musk

          Comment

          Working...
          X