The exconfig.c example program demonstrates how Client-Library application properties can be configured externally.
This example requires that you edit the default runtime configuration file, \ini\ocs.cfg, located in the Sybase installation directory. The example sets the CS_CONFIG_BY_SERVERNAME Client-Library property, and calls ct_connect with a server_name parameter set to “server1.” In response, Client-Library looks for a [Server1] section in the external configuration file. To run the example, create \ini\ocs.cfg located in the Sybase installation directory (if necessary), and add the following section:
[server1]
CS_SERVERNAME = real_server_name
where real_server_name is the name of the server that you want to connect to.
For more information on how Client-Library uses external configuration files, see the topics page “Using the Runtime Configuration File” in the Open Client Client-Library/C Reference Manual.