Table 5-1 compares the DB-Library calls used for initialization and cleanup with their Client-Library equivalents. For Client-Library, the default version level supports all the features starting with 10.x.
For detailed descriptions of each routine, see the reference page for the routine.
DB-Library routines |
DB-Library functionality |
Client-Library routines |
Client-Library functionality |
---|---|---|---|
(none) |
cs_ctx_alloc(version, context) |
Allocate a CS_CONTEXT structure and specify the version level for desired CS-Library behavior. version can be CS_VERSION_120, CS_VERSION_125, CS_VERSION_150, CS_VERSION_155, or CS_VERSION_157. |
|
(none) |
cs_config(context, CS_SET, CS_MESSAGE_CB, handler, CS_UNUSED, NULL) |
Install CS-Library error-handler callback function. |
|
dbinit() |
Initialize DB-Library. |
ct_init(context, version) |
Initialize Client-Library and specify the version level for desired behavior. |
dbsetversion(dbproc, version) |
(For DB-Library 10.x or later applications only.) Specify the version level for desired behavior. version can be DBVERSION_46 or DBVERSION_100. Sybase recommends DBVERSION_100 to be able to use the features and code changes introduced in the updated versions. |
(none) |
|
dberrhandle(handler) |
Install DB-Library error callback function. |
ct_callback(context, NULL,CS_SET, CS_CLIENTMSG_CB, handler) |
Install Client-Library error callback function. |
dbmsghandle(handler) |
Install DB-Library server message callback function. |
ct_callback(context, NULL, CS_SET, CS_SERVERMSG_CB, handler) |
Install Client-Library server message callback function. |
(See Table 5-2: “DB-Library vs. Client-Library—opening a connection”) |
Open connection(s). |
See Table 5-2. |
Open connection(s). Before you open the connection, set the required properties for the context/connection. |
dbexit() |
Close and deallocate all DBPROCESS structures and clean up any structures initialized by dbinit. |
ct_exit(context, option) |
Exit Client-Library. Before exiting Client-Library, deallocate all open command and context structures. option is normally CS_UNUSED. CS_FORCE_EXIT is useful when exiting because of an error. |
(none) |
cs_ctx_drop(context) |
Deallocate a CS_CONTEXT structure. |
The Client-Library application must allocate and deallocate CS_CONTEXT structure. CS_CONTEXT serves as “handle” for basic application properties, such as the language and character set for error messages and the application’s default error and message callbacks. See “The CS_CONTEXT structure”.