Announcement

Collapse
No announcement yet.

Script to add ODBC DSN with SQL + username/password

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

  • Script to add ODBC DSN with SQL + username/password

    I stole most of this other post I found on the web because it is exactly what I am looking for but their solution was incorrect.

    I'm looking to run a batch file or script on windows xp professional which creates an odbc data source for a sql server connection. I can create either a system DSN or a user DSN no problem:
    • odbcconf.exe /a {CONFIGDSN "SQL Server" "DSN=Premium Data Tables|Description=Premium Data Tables|SERVER=10.10.10.10"}
    • odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=Premium Data Tables|Description=Premium Data Tables|SERVER=10.10.10.10"}
    However, if I add the username/password onto the end of either, it errors out: |loginid=username|password=password

    I need a way to set the sql server authentication to be "With SQL Server authentication using a login ID and password entered by the user." This info will be provided ...somewhere...homehow....?

    Any ideas how I can add the SQL authentication with the script/batch? I DO NOT want to use the locally supplied credentials.

  • #2
    Re: Script to add ODBC DSN with SQL + username/password

    So what error are you getting?
    Sean McCown, SQL Server MVP

    See my FREE SQL Server training videos at:
    http://www.MidnightDBA.com

    Blog Author of:
    Database Underground -- http://infoworld.com/blogs/sean-mccown
    DBA Rant http://dbarant.blogspot.com

    Comment

    Working...
    X