ODBC Connect to DSN with Username and Password
Posted on 2007-11-19
Connecting to a SQL database using ODBC in C++. The SQLConnect(), function takes DSN name, username, and password strings as its params. I have created a system DSN with a username and password already configured. How do I tell SQLConnect that I wish to use the default authentication information in the DSN? I've tried calling SQLConnect with nulls for the username and password, but that doesn't work. Specifying the user name and password manually does work, but I do not want to hard code it or have to prompt the user for it.