Difference between revisions of "SQLDISCONNECT()"

From Lianjapedia
Jump to: navigation, search
Line 13: Line 13:
 
The SQLDISCONNECT() function operates on the ODBC connection specified by <nStatementHandle>.
 
The SQLDISCONNECT() function operates on the ODBC connection specified by <nStatementHandle>.
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
!width=30%|Keywords||width=70%|Description
+
!width="30%"|Keywords||width="70%"|Description
 
|-
 
|-
 
|nStatementHandle||Statement handle to the connection.  Specifying 0 causes all active connections to be disconnected.
 
|nStatementHandle||Statement handle to the connection.  Specifying 0 causes all active connections to be disconnected.
Line 22: Line 22:
 
====Return values:====
 
====Return values:====
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
!width=30%|Return Value||width=70%|Description
+
!width="30%"|Return Value||width="70%"|Description
 
|-
 
|-
 
|1||Disconnection completed successfully
 
|1||Disconnection completed successfully

Revision as of 10:19, 31 January 2013

Purpose

Disconnect from a data source

Syntax

SQLDISCONNECT(<nStatementHandle>)

See Also

SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLERROR(), SQLEXEC(), SQLGETPROP(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLSTRINGCONNECT(), SQLTABLES(), SQLTRANSACTION()

Description

The SQLDISCONNECT() function is used to disconnect from a data source.

The SQLDISCONNECT() function operates on the ODBC connection specified by <nStatementHandle>.

Keywords Description
nStatementHandle Statement handle to the connection. Specifying 0 causes all active connections to be disconnected.

Return values:

Return Value Description
1 Disconnection completed successfully
–1 Connection error
–2 Environment error

Example

nStatHand = sqlstringconnect("Driver={SQL Server};Server=MYPC-PC\INST1;Trusted_Connection=yes;Database=AdventureWorks;")
if nStatHand < 1
  messagebox("Could not connect")
else
  messagebox("Connected")
  // ...
  sqldisconnect(nStatHand)
endif