PC Review


Reply
Thread Tools Rate Thread

CopyFromRecordSet extremely slow

 
 
arno
Guest
Posts: n/a
 
      27th Sep 2007
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



 
Reply With Quote
 
 
 
 
sali
Guest
Posts: n/a
 
      27th Sep 2007
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
grupi:(E-Mail Removed)...
> Hello,
>
>So, we have here a problem of Excel and not of the configuration of
>databases, servers, odbc, etc., right?
>
> regards
>
> arno
>
>
>



 
Reply With Quote
 
arno
Guest
Posts: n/a
 
      27th Sep 2007
....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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET/IIS on XP Pro Extremely SLOW B Dunwoodie Microsoft ASP .NET 0 26th Apr 2004 12:03 PM
extremely slow pc Pixie Windows XP Performance 2 9th Apr 2004 12:31 PM
XP Extremely Slow Martin Racette Windows XP Hardware 12 11th Mar 2004 03:51 PM
xp extremely slow =?Utf-8?B?ZGF2ZQ==?= Windows XP Performance 2 18th Feb 2004 12:31 AM
extremely slow logon and slow down Trish Windows XP Performance 1 1st Aug 2003 02:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:09 PM.