Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Do I have to close an odc in a macro?

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Do I have to close an odc in a macro?

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.
--
HTH...

Jim Thomlinson


"Tachikrusher" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Do I have to close an odc in a macro?

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

"Tachikrusher" wrote in message
...
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Macro on close Donnie Excel Programming 6 August 29th 05 09:42 PM
On Close macro JudithJubilee[_2_] Excel Programming 14 March 8th 05 09:40 AM
Close Workbook from Macro Lou Excel Programming 2 May 18th 04 02:26 AM
Macro Close 2 Ronbo Excel Programming 1 May 5th 04 10:11 PM
Close Macro Ronbo Excel Programming 1 May 5th 04 08:33 PM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"