ODBC supplies a set of connection functions. Which of the following you use depends on how you expect your application to be deployed and used:
SQLConnect, which is the simplest connection function
SQLConnect takes a datasource name (DSN), and an optional user ID and password. You might want to use SQLConnect if you hard-code a datasource name into your application.
For more information, see SQLConnect in the Microsoft ODBC Programmer's Reference.
SQLDriverConnect, which connects to a datasource using a connection string
SQLDriverConnect allows the application to use Adaptive Server Enterprise-specific connection information that is external to the datasource.
On UNIX, the Adaptive Server ODBC Driver
supports only SQL_DRIVER_NOPROMPT.
You can also use SQLDriverConnect to connect without specifying a datasource.
For more information, see SQLDriverConnect in the Microsoft ODBC Programmer's Reference.
SQLBrowseConnect, which connects to a datasource using a connection string, like SQLDriverConnect.
SQLBrowseConnect allows your application to build its own dialog boxes to prompt for connection information, and to browse for datasources used by a particular driver—in this case, the Adaptive Server ODBC Driver.
For more information, see SQLBrowseConnect in the Microsoft ODBC Programmer's Reference.
For a complete list of connection parameters that can be used in connection strings, see Chapter 2, “Connecting to a Database.”