LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default Import extrenal data exceeds 65536

Hi Stacey:

"Stacey" wrote:

I realize Excel has a row limitation of 64K here,

Are there more elswhere?

I am attempting to retrieve a result set (from MSQuery) which has more rows
than Excel allows on one sheet


Excel allows 65k+ rows in one column
you can use the other columns

Basically I'd like to import all rows from the result set
into Excel, using multiple sheets. Does any one have any sample code
for auto generating a new sheet based on resultSet data (rather than
reading from a text file?)


Well yes I do , using ADO and you could bring it in to the same
sheet or whereever you want it.

For Example:

This puts the first 65k + 3 field Query into col a b c

cnt = Rs.RecordCount '//get record count if you need them
MsgBox "Count = " & cnt

Dim irow As Long

irow = 3

With Rs
.MoveFirst
Do Until irow = 65536
Worksheets("Sheet3").Range("A" & irow) = Rs("ProductID")
Worksheets("Sheet3").Range("B" & irow) = Rs("ProductName")
Worksheets("Sheet3").Range("C" & irow) = Rs("UnitPrice")
Debug.Print Rs("ProductName")

.MoveNext
irow = irow + 1
Loop
End With

cnt2 = Rs.AbsolutePosition '// where we at in the recordset
MsgBox "Position = " & cnt2

'/// here we move to d e f for the balance of the recordset
'/// see the recordset pointer remembers it's position or you can
'/// get it with the above code "Rs.AbsolutePosition"

irow = 3
With Rs
Do Until .EOF
Worksheets("Sheet3").Range("D" & irow) = Rs("ProductID")
Worksheets("Sheet3").Range("E" & irow) = Rs("ProductName")
Worksheets("Sheet3").Range("F" & irow) = Rs("UnitPrice")

.MoveNext
irow = irow + 1
Loop
End With

That's one way, Stacey.

If it happens to be an Access db post back and I'll post you
some connection code that you can play around with.

By the way I brought 88.000, 3 field records into columns a b c
and d e f in 64 seconds on an old laptop 1.6 I think.

Good Luck
TK
















 
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
data with more than 65536 lines Sephiroth Excel Discussion (Misc queries) 3 December 22nd 08 10:06 PM
Data exceeds chart limits Rebecca Charts and Charting in Excel 2 March 25th 08 12:16 AM
How Can I import external data what is more than 65536 lines? KurtHan71 Excel Discussion (Misc queries) 2 February 14th 08 01:51 PM
How do I import data into Excel that exceeds 70000 rows? Claudia Phelps Excel Discussion (Misc queries) 2 March 25th 05 11:33 PM
Import extrenal data exceeds 65536 Tim Williams Excel Programming 0 November 24th 04 02:18 AM


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