Terminates a connection to a data source.
Syntax
SQLDISCONNECT(nConnectionHandle)
Returns
Numeric
Arguments
nConnectionHandle
Specifies the connection handle to the data source returned by SQLCONNECT( ). Specify 0 for nConnectionHandle to terminate all active connections.
Remarks
SQLDISCONNECT( ) returns 1 if the connection is successfully terminated, – 1 if there is a connection level error, and – 2 if there is an environment level error.
SQLDISCONNECT( ) terminates a connection to a data source. You must supply the connection handle that SQLCONNECT( ) returned when you established the connection.
Note If you execute SQLDISCONNECT( ) within an asynchronous function sequence or during a transaction, SQLDISCONNECT( ) generates an error.