设置RE_DATA的pagesize,然后使用absolutetpaget指定要显示的页,再调用MshFlexgrid.refresh

解决方案 »

  1.   

    我赞成秋雨的说法,也许是Re_Data的默认页最大记录就这样,试着用分页的方法试试看.
      

  2.   

    分页之后必须有for i=1 to rst.pagesize循环对完纪录才可以。
    msdn
    Public Sub AbsolutePageX()
       
       Dim rstEmployees As ADODB.Recordset
       Dim strCnn As String
       Dim strMessage As String
       Dim intPage As Integer
       Dim intPageCount As Integer
       Dim intRecord As Integer   ' Open a recordset using a client cursor
       ' for the employee table.
       strCnn = "Provider=sqloledb;" & _
          "Data Source=srv;Initial Catalog=Pubs;User Id=sa;Password=; "
       Set rstEmployees = New ADODB.Recordset
       ' Use client cursor to enable AbsolutePosition property.
       rstEmployees.CursorLocation = adUseClient
       rstEmployees.Open "employee", strCnn, , , adCmdTable
       
       ' Display names and hire dates, five records
       ' at a time.
       rstEmployees.PageSize = 5
       intPageCount = rstEmployees.PageCount
       For intPage = 1 To intPageCount
          rstEmployees.AbsolutePage = intPage
          strMessage = ""
          For intRecord = 1 To rstEmployees.PageSize
             strMessage = strMessage & _
                rstEmployees!fname & " " & _ 
                rstEmployees!lname & " " & _ 
                rstEmployees!hire_date & vbCr
             rstEmployees.MoveNext
             If rstEmployees.EOF Then Exit For
          Next intRecord
          MsgBox strMessage
       Next intPage
       rstEmployees.CloseEnd Sub
      

  3.   

    我知道,但我想用最快的速度来显示想要的记录,我以前用VB5的时候,我是逐步添加的,就是一行一行的填充,但实际跟用Refresh来比速度慢了几倍,3千多条记录要等一段时间,而用Refresh自动填充,可以说没有什么感觉,这种差距是谁也不愿看到了,所以我就想用它自己的刷新,同时 gyang(杨杨) ,用在VB中使用Movenext,效率是很低的,想想11万条记录,一开始就从头开始历遍,那么就这样等啊等,我想回去试一下,能不能到了那一页,再对那一页历遍,同时我想定义好页面大小以后,能不能用Requery,来重新分一次页,虽说Requery后程序有明显的停顿,毕竟11万条记录,而Requery一次最多多耗不到2秒啊。希望大家如果有很好的建议能多多发表一下。
      

  4.   

    我觉得一张这么大的表用一个mshflexgrid显示好像不太合适吧
      

  5.   

    shuchang0626(舒畅) ,你认为怎么合适呢?