# Re: 限定资料量!!救人喔!

Posted by Miki on November 17, 1998 at 15:56:50:

In Reply to: 限定资料量!!救人喔! posted by Gary Chen on November 16, 1998 at 20:31:32:

: 请问在RDO中该如何设定才能有像在RDC中使用MaxRows一样的功能`
: 救命一下!
: 因为我现在有一次读出太多资料而中断ODBC的状况
: 万般感谢!

Set ResultRS = rdoCN.OpenResultset(SQL_String, rdOpenForwardOnly, rdConcurReadOnly, rdAsyncEnable)

ColCnt = ResultRS.rdoColumns.Count

Do While ResultRS.EOF = False
RS_Array = ResultRS.GetRows(1000) '一次取回1000笔资料
RowsReturned = UBound(RS_Array, 2) + 1 '取得阵列中所有的笔数
For II = 1 To RowsReturned
For j = 1 To ColCnt - 1
itemstring = itemstring & RS_Array(j - 1, II - 1) & vbTab
Next j
itemstring = itemstring & RS_Array(ColCnt - 1, II - 1)
MSFlexGrid1.AddItem "" & vbTab & itemstring
itemstring = ""
If CancelRS = True Then
ResultRS.Cancel
Exit Do
End If
DoEvents
Next II
Loop

Follow Ups: