Do I have to close an odc in a macro?

G

Guest

I have set up a macro in Excel that imports Access queries. The number of
queries the macro imports varies depending upon the number of changes showing
on the summary tab in my workbook. For each change, there are 3 queries that
run and I have an odc for each query. After the query is run, does the odc
have to be "closed"? I get an error if there are several changes on my
summary sheet.
 
G

Guest

The general rule that I follow is to always clean things up when you are done
playing (I gave my son the same rule to follow, but that is completely
different). If you are done with a connection close it and set it to nothing.
You will never go wrong following this guide line. Truth be known I could not
tell you what difficulties you might run into if you leave the connections
open because I have never been curious enough to find out.
 
N

NickHK

Tachikrusher,
You mean you currently:
Open connection, Issue query, Close connection.
Open connection, Issue query, Close connection.
Open connection, Issue query, Close connection.
for each change ?

Or
Open connection, Issue query, Issue query, Issue query, Close connection.

Also which error ?

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top