Hello,
I have a workbook that I created to import any table on our SQL server via ODBC and once I am done with table I completely clear the worksheet to it's original state (as if I just inserted a brand new sheet) and before I import another table, I would like to be able to loop through all the existing connections and delete them. I attempted this with the code below, however I don't really know how to work with the ODBC object model.
Please HELP!!!
I have a workbook that I created to import any table on our SQL server via ODBC and once I am done with table I completely clear the worksheet to it's original state (as if I just inserted a brand new sheet) and before I import another table, I would like to be able to loop through all the existing connections and delete them. I attempted this with the code below, however I don't really know how to work with the ODBC object model.
Code:
Sub DeleteConnections()
Dim Conn As ODBCConnection
For Each Conn In ThisWorkbook.Connections
[COLOR=seagreen]'Not sure what to put here.[/COLOR]
Next Conn
End Sub
Please HELP!!!