Jump to content

Changing password on System DSN


bab
 Share

Recommended Posts

I need to change/edit the password on a system dsn that uses sql authentication. I need to modify this  on 400 workstations. I wrote the following to change the password: 

 

run("rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl",@SystemDir,@SW_HIDE)
winwait("ODBC Data Source Administrator")
ControlCommand ( "ODBC Data Source Administrator", "", "SysTabControl321" , "tabright")
Send("!c")
winwait("Microsoft SQL Server DSN Configuration")
WinWaitActive("Microsoft SQL Server DSN Configuration", "This wizard")
Send("!n")
WinWaitActive("Microsoft SQL Server DSN Configuration", "How should")
Send("!P")
sleep(100)
send("newpassword")
sleep(100)
Send("!n")
WinWaitActive("Microsoft SQL Server DSN Configuration", "")
Send("!n")
WinWaitActive("Microsoft SQL Server DSN Configuration", "&Change the language of SQL Server system messages to")
Send("!c")
Send("{ENTER}")
winwait("ODBC Microsoft SQL Server Setup")
send("!t")
WinWaitActive("SQL Server ODBC Data Source Test", "Test Results")
Send("{ENTER}")
winwait("ODBC Microsoft SQL Server Setup")
send("{TAB}")
sleep(100)
Send("{ENTER}")
winwait("ODBC Data Source Administrator")
Send("{ENTER}")

My dilemma is that I have more than one system dsn. I cannot get to the right system dsn to edit (click the configure button). The editor does not show this list or text. How can I move to the right dsn to modify.

This is for 3rd party software; I have to use sql authentication. Thanks to anyone that can help.
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...