All the sample programs reference the example header file, sybdbex.h. The contents of sybdbex.h are:
/*
** sybdbex.h
**
** This is the header file that goes with the
** Sybase DB-Library sample programs.
**
**
*/
#define USER "sa"
#define PASSWORD ""
#define LANGUAGE "us_english"
#define SQLBUFLEN 255
#define ERR_CH stderr
#define OUT_CH stdout
extern void error();
int CS_PUBLIC err_handler PROTOTYPE(( DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr));
int CS_PUBLIC msg_handler PROTOTYPE(( DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *procname, int line));
All the sample programs except the data conversion sample program contain these lines:
DBSETLUSER(login, USER);
DBSETLPWD(login, PASSWORD);
Make these changes to the USER, PASSWORD, and LANGUAGE variables:
USER is defined in sybdbex.h as “sa.” Before you run the sample programs, edit sybdbex.h to change “sa” to your server login name.
PASSWORD is defined in sybdbex.h as null (“ “). You may want to edit sybdbex.h to change your server password.
Change your server password to “” 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.
In sybdbex.h, change the 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. When you are finished with the examples, edit the line so that it again reads “server_password.”
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. (Because this code is platform-specific, Sybase does not supply it.)
LANGUAGE is defined in sybdbex.h as “us_english.” If your server’s language is not “us_english,” you may want to edit sybdbex.h to change “us_english” to your server’s language. The international languages routine sample program, exampl12.c, is the only example that references LANGUAGE.