View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Close an active ODBC connection

How are you keeping it opened? Is ther are Public or Static variable that
you are using?

If ther is a variable associated with the connection then simply create a
workbook close event, close the conection variable, and then set the
Connection variable to equal nothing.

"Jeff" wrote:

I've got a connection to a SQL database that I create when I update the
source data. I keep it open to run multiple queries from the same source but
I want to close it when I close the workbook.

How can I close an active connection that was created and maintained in a
different sub-routine?