Siebel VB Language Reference > Methods Reference for Siebel VB > ODBC Methods >

ODBC Close Connection Method


The ODBC Close Connection method is a Siebel VB method that disconnects from an ODBC data source connection that the ODBC Open method established. It returns a variant that includes one of the following values:

  • 0. Successful disconnect.
  • -1. Connection is not valid.

If you call the ODBC Close Connection method with an argument that is not valid, then it replies with the undocumented return code of -2 (negative two), which indicates a data source connection that is not valid. The following items are examples of arguments that are not valid:

  • An SQLClose(0) argument
  • A variable argument that does not contain an initial value
Format

SQLClose(connection)

The following table describes the arguments that you can use with this method.

Argument
Description

connection

A named argument that the ODBC Open method returns. It must be a long integer. For information about named arguments, see Comments and Call Subroutine Method.

Example

The following example opens the data source named SblTest, gets the names in the ODBC data sources, and then closes the connection:

Sub Button_Click
'   Declarations

    Dim outputStr As String
    Dim connection As Long
    Dim prompt As Integer
    Dim datasources(1 To 50) As Variant
    Dim retcode As Variant
         
    prompt = 5
'   Open the data source "SblTest"
    connection = SQLOpen("DSN = SblTest", outputStr, prompt: = 4)

    action1 = 1 ' Get the names of the ODBC data sources
    retcode = SQLGetSchema(connection: = connection,action: _
     = 1,qualifier: = qualifier, ref: = datasources())

'   Close the data source connection
    retcode = SQLClose(connection)
      
End Sub

Siebel VB Language Reference Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.