Closing a Connection
The ODBC provides APIs for disconnecting from a database and releasing resources, as shown in Table 1.
Function |
API |
---|---|
Disconnect from the database. |
|
Release a handle. |
SQLFreeHandle is a generic function for releasing a handle. It can replace the following functions:
|
The following is an example (for details about the complete example, see Obtaining and Processing Data in a Database).
// Disconnect from the data source and release handles. SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt); SQLDisconnect(V_OD_hdbc); SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc); SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.