ODBC supplies a set of connection functions. Which one you use depends on how you expect your application to be deployed and used:
SQLConnect takes a data source name and optional user ID and password. You may want to use SQLConnect if you hard-code a data source name into your application.
For more information, see SQLConnect in the Microsoft ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms711810.aspx.
SQLDriverConnect allows the application to use SAP Sybase IQ-specific connection information that is external to the data source. Also, you can use SQLDriverConnect to request that the Sybase IQ ODBC driver driver prompt for connection information.
SQLDriverConnect can also be used to connect without specifying a data source. The Sybase IQ ODBC driver name is specified instead. The following example connects to a server and database that is already running.
SQLSMALLINT cso; SQLCHAR scso[2048]; SQLDriverConnect( hdbc, NULL, "Driver=Sybase IQ;UID=<user_id>;PWD=<password>", SQL_NTS, scso, sizeof(scso)-1, &cso, SQL_DRIVER_NOPROMPT );
For more information, see SQLDriverConnect in the Microsoft ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms715433.aspx.
SQLBrowseConnect allows your application to build its own windows to prompt for connection information and to browse for data sources used by a particular driver (in this case the Sybase IQ ODBC driver).
For more information, see SQLBrowseConnect in the Microsoft ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms714565.aspx.