I am trying export a large amount of data to excel from a recordset which fails presumably because of a timeout. How do I get the size of my recordset so that I can break it down using Chunks? My code thus far is
Do until RSRef.EOF
For Each F In RSREf.Fields
if F.Type = adDouble or F.Type = adInteger or F.Type = adNumeric or F.Type = adSingle then
if isnull(F.Value) then
Main = Main & ",""" & strSpace & """"
Else
Main = Main & "," & replace(F.Value,",","")
End IF
Else
if isnull(F.Value) then
Main = Main & ",""" & strSpace & """"
Else
Main = Main & ",""" & replace(F.Value,",","") & """"
End If
End if
Next
Main = Mid(Main,2) & vbCrLf
Response.ContentType = "text/plain"
Response.Write Main
Main=""
RSRef.Movenext
Loop
Do until RSRef.EOF
For Each F In RSREf.Fields
if F.Type = adDouble or F.Type = adInteger or F.Type = adNumeric or F.Type = adSingle then
if isnull(F.Value) then
Main = Main & ",""" & strSpace & """"
Else
Main = Main & "," & replace(F.Value,",","")
End IF
Else
if isnull(F.Value) then
Main = Main & ",""" & strSpace & """"
Else
Main = Main & ",""" & replace(F.Value,",","") & """"
End If
End if
Next
Main = Mid(Main,2) & vbCrLf
Response.ContentType = "text/plain"
Response.Write Main
Main=""
RSRef.Movenext
Loop