Begin detailed description.

This figure is a flowchart that depicts the functions that are used in a basic connection scenario. The functions that set and retrieve environment, connection, and statement attributes appear in this scenario where it would be appropriate to call these functions.

The following table shows the order in which you call functions to set and retrieve attributes as you make a connection to a database. Each row in this table represents a required function call, an optional function call, or a choice between function calls in a basic connection scenario.
Function call Usage Description
SQLAllocHandle() Required Allocates the environment handle.
SQLGetEnvAttr() Optional Retrieves the current setting for an environment attribute.
SQLSetEnvAttr() Optional Sets an environment attribute. You can set environment attributes only before you allocate a connection .
SQLAllocHandle() Required Allocates a connection handle.
SQLSetConnectAttr() Optional Sets a connection attribute that you can set only before you connect to the database.
SQLConnect() or SQLDriverConnect() Required choice Connects to the database. To connect to a database you can use either SQLConnect(), which makes a connection only, or SQLDriverConnect(), which makes a connection and sets keyword values.
SQLGetConnectAttr() Optional Retrieves a connection attribute.
SQLSetConnectAttr() Optional Sets a connection attribute, or the default for a statement attribute on that connection.
SQLAllocHandle() Required Allocates a statement handle.
SQLGetStmtAttr() Optional Retrieves the current setting of a statement attribute.
SQLSetStmtAttr() Optional Sets a statement attribute.

End detailed description.