All of the sample programs reference the example header file, example.h. The contents of example.h are:
/*
** example.h
**
** This is the header file that goes with the Sybase
** Client-Library example programs.
*/
/*
** Define symbolic names, constants, and macros
*/
#define EX_MAXSTRINGLEN 255
#define EX_BUFSIZE 1024
#define EX_CTLIB_VERSION CS_CURRENT_VERSION
#define EX_BLK_VERSION BLK_VERSION_155
#define EX_ERROR_OUT stderr
#define EX_BADVAL (CS_INT)-1
#define EX_MAX_ARR 64
/*
** exit status values
*/
#define EX_EXIT_SUCCEED 0
#define EX_EXIT_FAIL 1
/*
** Define global variables used in all sample programs
*/
#define EX_SERVER NULL /* use DSQUERY env var */
#define EX_USERNAME "sa"
#define EX_PASSWORD ""
/*
** Uncomment the following line to test the HA Failover feature.
*/
/* #define HAFAILOVER 1 */
#define EX_SCREEN_INIT()
Make these changes to EX_USERNAME and EX_PASSWORD:
EX_USERNAME is defined in example.h as “sa.” Before you use the sample programs, edit example.h to change “sa” to your server login name.
EX_PASSWORD is defined in example.h as null (“ ”) string. Before you use the sample programs, you may want to edit example.h and change this value to your server password. You can:
Change your server password to null (“ ”) while you are running the examples. However, this creates the possibility of a security breach; an unauthorized person can log in to the server as you. If this possibility presents a problem, choose one of the other methods of handling passwords for the sample programs.
Change the null (“ ”) string to your own server password. Use the operating system’s protection mechanisms to prevent others from accessing the header file while you are using it. After finishing the example, edit the line so that it reads “server_password” again.
In the sample programs, delete the ct_con_props code that sets the server password, and substitute your own code to prompt users for their server passwords. As this code is platform-specific, Sybase does not supply it.