Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pasting records into Excel with QueryTables

Hi,

I need to retrieve a recordset and paste into Excel. Initially, I
used a cursor and iterated through the recordset, pasting each field
into a cell. I found this really slow. I then read about
querytables, and have used this instead. It is so much faster, its
unbelievable.

The problem I have is with the number of records. Sometimes the
recordset can contain 70000 or 80000 records, and a single worksheet
only accepts 65536 rows. I would like to be able to get Excel to move
onto the next sheet once it has exhausted the number of rows. Is this
possible?

I have tried using the PageSize and AbsolutePage properties, but the
Querytables function seems to ignore these and tries to use the entire
recordset anyway.

I am currently trying GetRows and AddNew to write all txns to array,
and then write 65536 txns back to a recordset that I can use with
QueryTables. I'm not sure how to get a blank recordset that I can use
AddNew with?

I'm really not sure if I'm going about this right, does anybody have
any ideas?

Thanks in advance,
Saul Margolis
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Pasting records into Excel with QueryTables

Saul,

Presumably you were using ADO initially. You are probably best off sticking
with ADO (or DAO). Pasting fields individually is very slow. You should
check out the CopyFromRecordset method of the Range object that allows you
to dump your data very efficiently into a range.

You would still need to control the number of rows in a record set but you
should be able to do this in your SQL.

John Green
Sydney
Australia


"Saul Margolis" wrote in message
om...
Hi,

I need to retrieve a recordset and paste into Excel. Initially, I
used a cursor and iterated through the recordset, pasting each field
into a cell. I found this really slow. I then read about
querytables, and have used this instead. It is so much faster, its
unbelievable.

The problem I have is with the number of records. Sometimes the
recordset can contain 70000 or 80000 records, and a single worksheet
only accepts 65536 rows. I would like to be able to get Excel to move
onto the next sheet once it has exhausted the number of rows. Is this
possible?

I have tried using the PageSize and AbsolutePage properties, but the
Querytables function seems to ignore these and tries to use the entire
recordset anyway.

I am currently trying GetRows and AddNew to write all txns to array,
and then write 65536 txns back to a recordset that I can use with
QueryTables. I'm not sure how to get a blank recordset that I can use
AddNew with?

I'm really not sure if I'm going about this right, does anybody have
any ideas?

Thanks in advance,
Saul Margolis



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pasting records into Excel with QueryTables

Hi John,

Thanks. I haven't seemed to have found a way to split up a recordset
within Excel, so have implemented server-side paging.

Regards,
Saul



"John Green" wrote in message ...
Saul,

Presumably you were using ADO initially. You are probably best off sticking
with ADO (or DAO). Pasting fields individually is very slow. You should
check out the CopyFromRecordset method of the Range object that allows you
to dump your data very efficiently into a range.

You would still need to control the number of rows in a record set but you
should be able to do this in your SQL.

John Green
Sydney
Australia


"Saul Margolis" wrote in message
om...
Hi,

I need to retrieve a recordset and paste into Excel. Initially, I
used a cursor and iterated through the recordset, pasting each field
into a cell. I found this really slow. I then read about
querytables, and have used this instead. It is so much faster, its
unbelievable.

The problem I have is with the number of records. Sometimes the
recordset can contain 70000 or 80000 records, and a single worksheet
only accepts 65536 rows. I would like to be able to get Excel to move
onto the next sheet once it has exhausted the number of rows. Is this
possible?

I have tried using the PageSize and AbsolutePage properties, but the
Querytables function seems to ignore these and tries to use the entire
recordset anyway.

I am currently trying GetRows and AddNew to write all txns to array,
and then write 65536 txns back to a recordset that I can use with
QueryTables. I'm not sure how to get a blank recordset that I can use
AddNew with?

I'm really not sure if I'm going about this right, does anybody have
any ideas?

Thanks in advance,
Saul Margolis

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
Error when trying to use QueryTables.Add Mindblower Excel Programming 0 August 31st 04 01:44 PM
QueryTables Error GJones Excel Programming 0 April 27th 04 02:35 PM
With ActiveSheet.QueryTables.Add [email protected] Excel Programming 4 January 6th 04 04:58 PM
QueryTables Interrupt if URL is Down Steve Hieb Excel Programming 0 November 17th 03 10:07 PM


All times are GMT +1. The time now is 03:11 AM.

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

About Us

"It's about Microsoft Excel"