用Grid控件DataGrid
MsFlexGrid
MshFlexGrid
....

解决方案 »

  1.   

    您可以参考MSDN例子:C:\Program Files\Microsoft Visual Studio\MSDN\2001JUL\1033\SAMPLES\VB98\Msflexgd可能由于您的MSDN版本不同、安装位置不同而不同
      

  2.   

    用 MSHFlexGrid .
    先确定 数据所需的 行和列数.
    在用 .TextArray 填加数据
    With MSHFlexGrid
        .Rows = xxx 
        .Cols = xxx
        '//从 数据集 读如数据并填充
        Do Until Rs.Eof
        For I =0 To (.Rows-1)
            For J=0 To (.Cols -1)
                .TextArray(faIndex(I,J)) = Rs.Fields("Data").Value
            Next
        Next
        Loop
    End with关于 faIndex 函数, MSDN 上已有.
      

  3.   

    那使用datagrid、msflexgrid、mshflexgrid,那一个可以把记录分页显示出来?
      

  4.   

    关键是 使用 ADO 的 PAGESIZE 属性 和 AbsolutePage 属性。
    -------------------------------------------------------------------
    下面的代码给你参考一下:
    m1 是个 Grid 控件。Function Getpagedate(ByVal TSQL As String, ByVal pagenumber As Integer, ByVal size As Integer) As Long
    Screen.MousePointer = 11
    Dim x As IntegerIf rs1.State = 1 Then rs1.Close
    rs1.CursorLocation = adUseClient
    rs1.Open TSQL, conn1, adOpenForwardOnly, adLockReadOnly
    If rs1.EOF Then
        mg1.Rows = 1
        mg1.Rows = mg1.Rows + 1
        mg1.FixedRows = 1
        Label2(4).Caption = "Record Count:" & "0" & "  Page Count:" & "0"
        Screen.MousePointer = 0
        Exit Function
    End Ifmg1.Rows = 1
    mg1.Cols = rs1.Fields.Count
    rs1.PageSize = size
    If pagenumber > rs1.PageCount Then
        txtpn = 0
        pagenumber = 1
    ElseIf pagenumber <= 0 Then
        txtpn = rs1.PageCount + 1
        pagenumber = rs1.PageCount
    End If
    rs1.AbsolutePage = pagenumber
    txtpn.Text = rs1.AbsolutePage
    mg1.Visible = False
    With mg1
        Do While Not rs1.EOF And rs1.AbsolutePage = pagenumber
            .Rows = .Rows + 1
            .FixedRows = 1
           For x = 0 To rs1.Fields.Count - 1
                .TextMatrix(.Rows - 1, x) = IIf(IsNull(rs1.Fields(x).value), "", rs1.Fields(x).value)
                If x = 4 Or x = 3 Then
                   .TextMatrix(.Rows - 1, x) = Format(.TextMatrix(.Rows - 1, x), "Fixed")
                   If Val(.TextMatrix(.Rows - 1, x)) = 0 Then .TextMatrix(.Rows - 1, x) = ""
                   .ROW = .Rows - 1: .COL = x
                   If Val(.TextMatrix(.Rows - 1, x)) < 0 Then .CellForeColor = vbRed Else .CellForeColor = vbBlue
                End If
           Next
           rs1.MoveNext
        Loop
        Label2(4).Caption = "Record Count:" & CStr(rs1.RecordCount) & "  Page Count:" & rs1.PageCount
        Getpagedate = rs1.RecordCount
        rs1.Close
        Screen.MousePointer = 0
        mg1.Visible = True
        .Refresh
    End With
    End Function