exconfig.c

The exconfig.c sample program demonstrates how Client-Library application properties can be configured externally.

This sample requires you to edit the default runtime configuration file, \config\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 \config\ocs.cfg in the Sybase installation directory (if necessary) and add the 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.