Don’t use SQLClose and the other ODBC functions in the Xlodbbc.xla add-in; use the objects, methods, and properties in the Microsoft ActiveX Data Objects (ADO) library instead. For more information about ActiveX Data Objects, see Welcome To ADO.
SQLClose closes a connection to an external data source.
This function is contained in the Xlodbc.xla add-in. Before you use the function, you must establish a reference to the add-in by using the References command (Tools menu).
Syntax
SQLClose(ConnectionNum)
ConnectionNum Required. The unique connection ID of the data source you want to disconnect from.
Return Value
If the connection is successfully closed, this function returns 0 (zero) and the connection ID is no longer valid.
If ConnectionNum isn’t valid, this function returns Error 2015.
If SQLClose is unable to disconnect from the data source, it returns Error 2042.