I have the code which can successfully pull data from database, but my question is related to something else.
I do NOT want to copy data to sheet Test, for two reasons:
1) The return query data may have many records (exceeding maximum excel 2013 row limitation 1,048,576), which will cause the code bug
2) I will need further process the data, it is very time consuming to loop through excel data.
So I am thinking about sorting data in memory, processing data in memory should be much faster than processing data in spreadsheet. I will copy final data (after being processed) into spreadsheet. That being said, I do NOT want this line of code (ThisWorkbook.Sheets("Test").Cells(7, 5).CopyFromRecordset CVRs) at this point, I want to sort the data into an dynamic array, since I don't know how many records from CVRs.
Maybe I need a line to code to count the number of returned records? If the number of records is k, then
How to count the number of record? How to store the records into the arrays?![]()
Please Login or Register to view this content.
Thanks.
![]()
Please Login or Register to view this content.
Bookmarks