Allocating a Statement Handle ODBC

Before the application can execute a statement, it must allocate a statement handle as follows:

The application declares a variable of type HSTMT. It then calls SQLAllocHandle and passes the address of this variable, the handle of the connection in which to allocate the statement, and the SQL_HANDLE_STMT option. For example: