我想实现下面的结果在datagrid中显示,请写出代码,谢谢!
Date Series            AssyPN          Failure Description
201012-20 NEO           750-031088 hsl2fail
201012-20 NEO           750-031088 hsl2fail
201012-20 NEO           750-031088 hsl2fail
201012-20 AgentSimth  750-031088       hsl2fail
201012-21 AgentSimth  750-031088 hsl2fail
201012-21 NEO           750-031088 boot fail
201012-21 NEO           750-031088 boot fail
201012-21 NEO           750-031088 boot fail
201012-21 NEO           750-031088 boot fail
201012-21 AgentSimth  750-031088 boot fail
201012-21 AgentSimth  750-031088 boot fail
201012-21 AgentSimth  750-031088 boot fail
201012-21 AgentSimth  750-031088 diag luchip fail
201012-22 AgentSimth  750-031088 diag luchip fail
201012-22 AgentSimth  750-031088 diag luchip fail
201012-22 AgentSimth  750-031088 diag luchip fail
201012-22 NEO           750-031088 diag luchip fail
201012-22 NEO           750-031088 diag luchip fail
201012-22 NEO           750-031088 diag luchip fail
201012-22 NEO           750-031088 diag luchip fail
201012-23 NEO                750-031088 diag luchip fail
201012-23 NEO           750-031088 diag luchip fail
201012-23 AgentSimth  750-031088 ram_bist all stress
201012-23 AgentSimth  750-031088 ram_bist all stress
201012-23 AgentSimth  750-031088 ram_bist all stress
201012-23 AgentSimth  750-031088 ram_bist all stress
201012-23 NEO           750-031088 ram_bist all stress
201012-23 NEO           750-031088 ram_bist all stress
201012-23 NEO           750-031088 ram_bist all stress
201012-23 NEO           750-031088 ram_bist all stressTopIssue Failure Description Count
Top 1 diag luchip fail          10
Top 2 ram_bist all stress 8
Top 3 hsl2fail                   6

解决方案 »

  1.   

    VB控件如何使用的问题,与 ACCESS 关系不大
      

  2.   

    select top 3 from (
    select [Failure Description],count(*) as [Count]
    from table1
    group by 2 desc
    )
      

  3.   

    'Ctrl+t找Microsoft DataGrid Control.... 
    '菜单"工程"->"引用" 找 Microsoft ActiveX Data Object.... Dim cn As New ADODB.Connection
        Dim rst As New ADODB.Recordset
        Dim SqlStr As String
        cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Mode=ReadWrite;Persist Security Info=False;Jet OLEDB:Database Password=111"
        SqlStr = "Select Date,Series,AssyPN,Failure,Description From 某个表"
        rst.CursorLocation = adUseClient
        rst.Open SqlStr, cn, adOpenDynamic, adLockOptimistic, adCmdText '打开记录集
    Set DataGrid1.DataSource = rst '给DataGrid修改数据源