Functions for setting and retrieving connection attributes

To specify a new value for a connection attribute, call SQLSetConnectAttr(). To obtain the current value of a connection attribute, call SQLGetConnectAttr().

You can set a connection attribute only within one of the following periods of time. This period differs for each specific connection attribute.
  • Any time after the connection handle is allocated
  • Only before the actual connection is established
  • Only after the connection is established
  • After the connection is established only if that connection has no outstanding transactions or open cursors

To obtain the current value of a connection attribute, call SQLGetConnectAttr().