Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Using ADODB Efficiently

Hi,

I have an excel worksheet where a number of cells use a UDF to retrieve data
from an access database, the UDF uses ADODB to communicate to the database.
When the spreadsheet updates the formulas it takes quite a while to calculate
the cells I think its because for each cell that contain the UDF, the UDF
creates a new connection to the database is there a more efficient way of
doing this maybe re-using the one connection?

Thanks.
Simon

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Using ADODB Efficiently

Save the connection as a static object variable in the UDF and test if it is
nothing or not (set connection if so), or as a module level variable and do
likewise.

--
__________________________________
HTH

Bob

"Simon" wrote in message
...
Hi,

I have an excel worksheet where a number of cells use a UDF to retrieve
data
from an access database, the UDF uses ADODB to communicate to the
database.
When the spreadsheet updates the formulas it takes quite a while to
calculate
the cells I think its because for each cell that contain the UDF, the UDF
creates a new connection to the database is there a more efficient way of
doing this maybe re-using the one connection?

Thanks.
Simon



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
Can I use a pivot table with this efficiently? Darren Ingram Excel Discussion (Misc queries) 0 February 24th 09 10:08 AM
Efficiently Generate 88 Chartsheets [email protected] Excel Worksheet Functions 3 July 5th 06 01:53 PM
How to efficiently declare variables Jeff Excel Discussion (Misc queries) 2 June 29th 06 01:56 PM
How to get 500 hyperlink address efficiently? liru Excel Discussion (Misc queries) 4 May 16th 06 03:56 AM
Getting data efficiently MAB[_6_] Excel Programming 0 September 8th 04 06:17 AM


All times are GMT +1. The time now is 07:29 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"