View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheetfunctinos
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Optimizing performance of functions that access a database

I think Niek means Dictionaries from the Scripting Runtime
library, not Directories.

In my experience dictionaries s/b well suited for this task.

Collections can maintain ordered lists by inserting items on a
specified position while Dictionaries cannot, but this should be no
problem.

Dictionaries are more versatile and faster than collections

Advantages:
check if a key exists (collection must be tested with on error resume)

compare keys case sensitive
(keys are not necessarily strings, so you can use (long) numbers

change keys

retrieve the arrays of the keys and items. (collection's items must be
retrieved by enumerating the items)

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Niek Otten wrote :

Hi Yarik,
SNIP

I've read that Directories can be even faster, but haven't had time
yet to try. It probably depends on the nature of your keys and the
pattern of access. If you try, please let us know the results.