ODBC Users` Manual

Add to My manuals
280 Pages

advertisement

ODBC Users` Manual | Manualzz

SQLDisconnect

SQLDisconnect

SQLDisconnect colses a connection and releases the handles for the connection.

Syntax

SQLRETURN SQLDisconnect (

SQLHDBC dbc );

Arguments

Data Type

SQLHDBC

Argument dbc

In/Out

Input

Description

Connection Handle

Return Values

SQL_SUCCESS

SQL_SUCCESS_WITH_INFO

SQL_INVALID_HANDLE

SQL_ERROR

Description

If an application calls SQLDisconnect () before releasing the statement handles related to the connection, the connection with the database will be closed.

When SQL_SUCCESS_WITH_INFO is returned, it means that database is successfully disconnected but additional errors or specified implementation program data exist. The cases are as follows:

An error occurred after disconnection. When connection is not established due to other problems such as communication failure

An application can use the databasec to request another SQLConnect () after successfully calling

SQLDisconnect ().

* To connect another database after calling this function, call SQLConnect () or SQLDriverConnect ().

ODBC Users’ Manual 58

Diagnosis

SQLSTATE

HY000 General error

Description

Related Functions

SQLAllocHandle

SQLConnect

SQLDriverConnect

SQLEndTran

SQLFreeConnect

Example

See: $ALTIBASE_HOME/sample/SQLCLI/demo_ex1.cpp

SQLDisconnect( dbc );

Comments

SQLDisconnect

59 ODBC Functions

advertisement

advertisement

Table of contents