Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ODBC Disconnect

Re: ODBC Disconnect

From: Paul Sheldon <pauls_at_sandsmac.com.au>
Date: 1997/07/17
Message-ID: <01bc9269$aa3c6f40$0e3520cb@paulsh>#1/1

This is using the ODBC API...

Function DisconnectFromDatasource(hdbc As Long, hstmt As Long) As Integer     

    'Function Returns False if any API call fails; True otherwise     

    Dim Result As Integer    

    On Error GoTo DisconnectFromDatasource_Error    

    DisconnectFromDatasource = True

    'statement handle
    If hstmt <> 0 Then

        Result = SQLFreeStmt(ByVal hstmt, SQL_DROP)
        hstmt = 0
        If Result <> SQL_SUCCESS Then DisconnectFromDatasource = False
    End If
    'database handle
    If hdbc <> 0 Then
        Result = SQLDisconnect(ByVal hdbc)
        If Result <> SQL_SUCCESS Then DisconnectFromDatasource = False
    End If
    If hdbc <> 0 Then
        Result = SQLFreeConnect(ByVal hdbc)
        If Result <> SQL_SUCCESS Then DisconnectFromDatasource = False
    End If
    Exit Function     

DisconnectFromDatasource_Error:

    DisplayErrorMessage "DisconnectFromDatasource", "ODBCVB.Bas"     Resume Next     

End Function

Paul.

davehall_at_umich.edu wrote in article <868896124.6886_at_dejanews.com>...
> I need some major help. How do you diconnect from a ORACLE ODBC Driver
> from VB 4.0 without restarting the entire program.
>
> Dave Hall
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>
Received on Thu Jul 17 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US