Skip to content

SQLFreeConnect

SQLFreeConnect#

SQLFreeConnect() frees resources associated with a specific connection.

SQLFreeConnect() has been replaced by SQLFreeHandle().

Syntax#

SQLRETURN  SQLFreeConnect (
    SQLHDBC     dbc );

Argument#

Data Type Argument In/Output Description
SQLHDBC dbc Input Connection handle pointer

Return Values#

SQL_SUCCESS
SQL_INVALID_HANDLE
SQL_ERROR

Description#

When this function is called in the connected status, SQL_ERROR will be returned but the connection handle is still valid.

SQLDisconnect
SQLFreeEnv

Example#

< Refer to: $ALTIBASE_HOME/sample/SQLCLI/demo_ex1.cpp >

if ( conn_flag == 1 )
{   
    SQLDisconnect( dbc );
}
if ( dbc != NULL )
{
    SQLFreeConnect( dbc );
}
if ( env != NULL )
{   
    SQLFreeEnv( env );
}