Docs: SpeedGen ASP: The ReadAhead Parameter

Parameter: ReadAhead
Purpose

This is the number of rows to retrieve from the ADO RecordSet. Set to 0 to disable ReadAhead.

ReadAhead is a parameter of the AddRS_ADO methods.

Example
myXLS_obj.AddRS_ADO Rs1, 50 'Read 50 rows a time


or

myXLS_obj.AddRS_ADO Rs1, 0 ' Disable ReadAhead
Description

Using ReadAhead can result in dramatic speed savings, especially on slower computers or computers with slow or network database connections.

example: If ReadAhead = 100 and there are 830 rows in the RecordSet then the RecordSet will be queried 9 times. Each time 100 rows will be read into memory.

Notes
  • Set to 0 to disable. In many cases this will still be slower than a value of 1.
  • ReadAheads uses GetRows. The ReadAhead property performs its magic by calling the GetRows method of the ADO RecordSet. Therefore you never need to worry about implementing a call to GetRows yourself. In fact, you will never be able to achieve the memory conservation that SpeedGen gets because when it uses ReadAhead it uses only the Fields required for the current row on the spreadsheet.
  • Experiment for Best Performance. If you have a large number of Rows or Fields then you should really experiment with this value. Try small, medium and large values (0, 10, 50, 100) to see what works best.
  • If ReadAhead is larger than the number of rows in the RecordSet, then all Rows will be read into memory.
  • Only Required Fields are Loaded. Only the fields that are used in the Excel rows currently being written are loaded into memory. So you don't have to worry about binary or other fields accidentally being loaded into memory.

(c) 2000-2003 Optimized Software Canada Inc. All Rights Reserved.

Microsoft® Excel is a Registered Trademark of Microsoft Corporation.