I know this question is ancient, but it probably often appears so much that I will share the answer that I know. The easiest way to achieve what you are trying to do is to create what is called a "DSN-Less Connection".
In short, you create a connection string that is used when opening a connection that identifies the driver and includes all the parameters that you usually fill in when creating the DSN for this driver.
This method has existed for a very long time - I used it in 2001, and it was older than this.
The following is an example of a DSN-Less connection string sequence for accessing SAS data through ODBC:
Using Server ID Provider=sas.ShareProvider;Data Source=shr1;
SAS / SHARE Using server identifier and node (network name) Provider = sas.ShareProvider; Data Source = shr1; Location = lambchop.unx.sas.com;
SAS / SHARE Indication of user and password Provider=sas.ShareProvider;Data Source=shr1;Location=lambchop.unx.sas.com; User ID=myUsername;Password=myPassword; Provider=sas.ShareProvider;Data Source=shr1;Location=lambchop.unx.sas.com; User ID=myUsername;Password=myPassword;
SAS / SHARE Server requires password Provider=sas.ShareProvider;Data Source=shr1;Location=lambchop.unx.sas.com; User ID=myUsername;Password=myPassword; SAS Server Access Password=myServerPassword; Provider=sas.ShareProvider;Data Source=shr1;Location=lambchop.unx.sas.com; User ID=myUsername;Password=myPassword; SAS Server Access Password=myServerPassword;
This is from: https://www.connectionstrings.com/sas-share/
The SAS support page discusses this more ... I found it here: http://docslide.us/documents/opening-an-ado-connection-object.html
source share