SQLConnect assumes that a data source name, username, and password are sufficient to connect to a data source and that all other connection information can be stored on the system. This information is stored in the DSN Settings file in the registry on Windows in the user's odbc.ini file.
SQLCHAR * ServerName,
SQLCHAR * UserName,
SQLCHAR * Authentication,
SQLConnect establishes a connection to a driver and a data source. The connection handle references storage of all information about the connection to the data source, including status, transaction state, and error information.
SQLConnect is the simplest connection function. It requires a ServerName (data source name) and accepts an optional UserName and Authentication (typically a password). The UserName and Authentication parameters are passed unmodified to the driver. SQLConnect works well for applications that hard-code a data source name and do not require a UserName or Authentication.
It also works well for applications that want to control their own look and feel or that have no user interface. Such applications can build a list of data sources using SQLDataSources, prompt the user for data source, UserName, and Authentication, and then call SQLConnect.
SQLConnect establishes an authenticated connection using the authentication mechanism selected. SQLConnect returns SQL_ERROR and a new error message if no authentication mechanism can be selected.
If TeraSSO allows fully qualified usernames then the username might contain a domain or realm, for example: george@linedata.