0
Reply

Changing ODBC system DSN programmatically

Ehab

Ehab

Nov 17 2010 7:07 AM
12.9k
I have an application (made by C++) connect to a SQL database server through ODBC SQL driver and I have 2 different SQL servers each server has its IP (this application did not stored the connection string in a config file), every time the user want to work with a specific server I change manually the ODBC settings to the database IP, password, ...etc because the application use only one name of the ODBC DSN (this application is not from my work so I don't have the source of it to change). I know that if I make another program (with C# .Net 2) to change the value of the server key in the registry I couldn't enter the user id and the password, so could I make 2 ODBCs SQL driver for each database server and make my program to change the name of the system DSN to the one used by the main application or there is another way to make one System DSN and make a program to change the value of the server key only.