Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default CopyFromRecordSet extremely slow

Hello,

Excel 2003

I have been using ADO to query Access Databases (which contain only of
ODBC-links) for ages. Now I try to setup the same configuration (here
Firebird database linked to an Access 2002 mdb) in another company. Running
the queries from Excel 2003 works, however, copyfromrecordset takes 5min to
finish for 2 fields and 1000 records. Does somebody know why this can take
so long and how to speed it up?

The same query in Access works in a second. (The query in the Excel macro is
also very fast, only the line with copyfromrecordset takes ages.) So, we
have here a problem of Excel and not of the configuration of databases,
servers, odbc, etc., right?

regards

arno



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default CopyFromRecordSet extremely slow

i also found that sometimes request of allocating great number of small
memory pieces may dramaticaly slow down the excel macro execution [as a
allocation goes on, the speed decreases], try to check available memory

just to clear, you may execute the same ado command set from the vbscript
interpreter. vbscript is almost 100% excel vba macro compatible, just test
the problemnatic code segment


"arno" <nospam@invalid je napisao u poruci interesnoj
...
Hello,

So, we have here a problem of Excel and not of the configuration of
databases, servers, odbc, etc., right?

regards

arno





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default CopyFromRecordSet extremely slow

....more Info, maybe a solution:

1) I turned off screenupdating and I have calculation set to manual with not
positive effect.

2) when I import the tables into Access my queries are extremely fast
(compared to the linked tables)

Copyfromrecordset is slow when I use linked tables and fast if I use "real"
tables? Why does copyfromrecordset depend on where I get my data from??


3) So, there appears to be something wrong with the connection, I used this
one:

rs.Open sqlstring.Value, cn, adOpenStatic, adLockOptimistic

and replaced it with this one:

rs.Open sqlstring.Value, cn, adOpenStatic, adLockReadonly

I would also use adOpenForwardOnly, however, then rs.recordscount does not
work anymore and I do not know how many records I received. Maybe there's no
impact on performance.

Now I am within 2 or 3 seconds for my 1000 records :)

Strange, isn't it?

arno


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
Excel Extremely Slow KMH Excel Discussion (Misc queries) 2 June 30th 09 01:27 PM
Opens extremely slow DrYauney Excel Discussion (Misc queries) 0 July 16th 07 07:22 PM
Extremely slow macro CLR Excel Programming 3 January 17th 07 06:58 PM
EXTREMELY slow toolbars? Maury Markowitz Excel Programming 0 May 23rd 06 04:17 PM


All times are GMT +1. The time now is 10:53 AM.

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"