Hi, all,
I am trying to load a spreadsheet (OWC) on my ASP page directly from the RecordSet.
However, since the returned recordset can be huge, I will only load the spreadsheet with first 1000 rows, if users choose to see the next 1000 rows, I will load the next 1000 rows - pretty much treating the spreadsheet as a list box but with Excel functions.
I do by something like this:
Code:
rs.CursorLocation = 3 'adUseClient
Code:
rs.CursorType = 1 'adOpenKeyset
rs.LockType = 3 'adLockOptimistic
rs.PageSize = 1000
rs.Open sSQL, Cnn
SS1.ActiveSheet.Cells.copyFromRecordset rs,1000
And this has been successful. But when I try to load the next 1000 rows, it still displays the first 1000 rows. I do this by:
Code:
rs.AbsolutePage = 2
Code:
SS1.ActiveSheet.UsedRange.ClearContents
SS1.ActiveSheet.Cells.copyFromRecordset rs,1000
I check the recordset before the "copyFromRecordset" method, and the recordset is at the correct position. But the "copyFromRecordset" seems to ignore it, and load the spreadsheet from the BOF of the recordset.
Anyone knows about this? Thanks.