In DB-Library, applications use the LOGINREC structure to customize a connection before opening it. In Client-Library applications, use CS_CONNECTION properties to customize a connection before opening it.
To replace DB-Library code that uses the same LOGINREC structure to open several connections, you can use ct_getloginfo and ct_setloginfo, as follows:
Allocate a connection structure with ct_con_alloc.
Customize the connection with calls to ct_con_props.
Open the connection with ct_connect.
For each connection to be opened with the same login properties:
Call ct_getloginfo to allocate a CS_LOGINFO structure and copy the original connection‘s login properties into it.
Allocate a new connection structure with ct_con_alloc.
Call ct_setloginfo to copy login properties from the CS_LOGINFO structure to the new connection structure. After copying the properties, ct_setloginfo deallocates the CS_LOGINFO structure.
Customize any non-login properties in the new connection with calls to ct_con_props.
Open the new connection with ct_connect.