exconfig.c sample program

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, $SYBASE/$SYBASE_OCS/config/ocs.cfg file. 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 $SYBASE/$SYBASE_OCS/config/ocs.cfg (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.