Properties are not always supported. A property may be unsupported in the following instances.
The property is associated with external directory provider software.
Some of the CS_DS properties control the behavior of external directory provider software (indicated by the connection’s CS_DS_PROVIDER property). Sybase’s directory driver maps the Client-Library property to an equivalent service-provider setting. However, if the provider has no equivalent setting, the property is not supported. Applications cannot call ct_con_props to get, set, or clear the value of unsupported directory properties.
The property is associated with external security provider software.
Some of the CS_SEC properties enable security services, such as data encryption, that are performed by external security software (indicated by the CS_SEC_MECHANISM property). Sybase’s security driver maps the Client-Library property to an equivalent service-provider setting. However, a security mechanism may not support every service. Applications cannot call ct_con_props or ct_config to enable a security service that is not supported by the current security mechanism for the connection or context.
Applications check to determine whether a property is supported by calling ct_config or ct_con_props with the action parameter as CS_SUPPORTED and the buffer parameter as the address of a CS_BOOL variable.
For example, the following code checks to see if the CS_DS_SEARCH property is supported. You can use this sample code to check support for other properties by replacing the CS_DS_SEARCH parameter with the parameter you are interested in.
/* Is CS_DS_SEARCH supported? */ ret = ct_con_props(conn, CS_SUPPORTED, CS_DS_SEARCH, &boolval, CS_UNUSED,NULL); if (ret != CS_SUCCEED) ... handle the error ... printf("CS_DS_SEARCH %s supported", boolval == CS_TRUE ? "is" : "is not");
The CS_SUPPORTED action is allowed only for properties associated with a directory or security driver.