![]() | ![]() |
Home |
|
|
Open Client Client-Library/C Reference Manual |
|
| Chapter 2 Topics |
|
| Capabilities |
|
| Setting and retrieving capabilities |
Before calling ct_connect, an application:
Retrieves request or response capabilities to determine what request and response features are normally supported at the connection's current TDS version level. A connection's TDS level defaults to the version level that the application requested in its call to ct_init. An application can change a connection's TDS level by calling ct_con_props with property as CS_TDS_VERSION (see "TDS version").
Sets response capabilities to indicate that a connection does not wish to receive particular types of responses. For example, an application sets a connection's TDS_RES_NOEED capability to CS_TRUE to indicate that the connection does not wish to receive extended error data.
After a connection is open, an application:
Retrieves request capabilities to find out what types of requests the connection will support
Retrieves response capabilities to find out whether the server has agreed to withhold the previously indicated response types from the connection
Gateway applications often need to set or retrieve all capabilities of a type category with a single call to ct_capability. To do this, an application calls ct_capability with:
type as the type category of interest
capability as CS_ALL_CAPS
value as a CS_CAP_TYPE structure
Client-Library provides the following macros to enable an application to set, clear, and test bits in a CS_CAP_TYPE structure:
CS_CLR_CAPMASK(mask, capability) - modifies the CS_CAP_TYPE structure mask by clearing the bits specified in capability..
CS_SET_CAPMASK(mask, capability) - modifies the CS_CAP_TYPE structure mask by setting the bits specified in capability.
CS_TST_CAPMASK(mask, capability) - determines whether the CS_CAP_TYPE mask includes the bits specified in capability.
|
|