All of the sample programs reference the sample header file, sybdbex.h. The contents of sybdbex.h are as follows:
/*
** sybdbex.h
**
** This is the header file that goes with the
** Sybase DB-Library example programs.
**
**
*/
#define USER "user"
#define PASSWORD "server_password"
#define LANGUAGE "us_english"
#define SQLBUFLEN 255
#define ERR_CH stderr
#define OUT_CH stdout
extern void error();
extern int err_handler();
extern int msg_handler();
All of the samples except Example 5 contain these lines:
DBSETLUSER(login, USER);
DBSETLPWD(login, PASSWORD);
Following are descriptions of edits for the lines in sybdbex.h:
USER is defined in sybdbex.h as “user.” Before running the sample programs, you must edit sybdbex.h and change “user” to your server login name.
PASSWORD is defined in sybdbex.h as “server_password.” Before running the sample programs, edit sybdbex.h and change “server_password” to your server password. Choose one of the following options for PASSWORD:
Option 1: Change your server password to “server_password” while you are running the samples. This creates the possibility of a security breach, because while your password is set to this published value, an unauthorized person might take the opportunity to log in to the server as you. If this is a problem, choose one of the other options.
Option 2: In sybdbex.h, change the string “server_password” 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 sample, edit the line so that it again says “server_password.”
Option 3: In the sample programs, delete the DBSETLPWD line entirely, and substitute your own code to prompt users for their server passwords. (Because this code is platform-specific, Sybase does not supply it.)
LANGUAGE: If your server’s language is not U. S. English, edit the LANGUAGE line in sybdbex.h so that it is the same as the server’s. Example 12 is the only sample that references LANGUAGE.