Copying login properties

A login property is a connection property that specifies a value needed to connect to a server. For example, CS_USERNAME and CS_PASSWORD are login properties.

An application copies login properties from an established connection to a new connection structure. To do this, an application:

  1. Allocates a connection structure (ct_con_alloc).

  2. Customizes the connection (ct_con_props).

  3. Opens the connection (ct_connect).

  4. Calls ct_getloginfo to allocate a CS_LOGINFO structure and copy the connection‘s login properties into it.

  5. Allocates a second connection structure (ct_con_alloc).

  6. Calls ct_setloginfo to copy login properties from the CS_LOGINFO structure to the second connection structure. After copying the properties, ct_setloginfo deallocates the CS_LOGINFO structure.

  7. Customizes any properties which should be different in the second connection (ct_con_props).

  8. Opens the second connection (ct_connect).