Mshflexgrid控件显示数据时缺少表头?请教!
Mshflexgrid控件显示数据时缺少表头?请教!
程序代码:
With MSHFlexGrid1 '设置网格列表的最大行和列 .Rows = maxRows .Cols = maxRows ' .CellAlignment = flexAlignCenterCenter '将多余的列隐藏起来 For i = maxRows - 1 To maxCols Step -1 MSHFlexGrid1.ColWidth(i) = 0 Next i '使该控件具有合并单元格的功能 MSHFlexGrid1.MergeCells = flexMergeFree End With ' 实例化Connection 对象 Set conn11 = New ADODB.Connection ' 设置连接提供者名称 conn11.Provider = "MSDataShape" ' 设置连接字符串 conn11.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Aging.mdb " '设置数据库路劲 ' 打开到数据源的连接 conn11.Open 'shape指令 rs11.StayInSync = True ' 打开游标 rs11.Open "select * from 数据 '", conn11, 3, 2 ' 设置MSHFlexGrid控件数据源 Set MSHFlexGrid1.DataSource = rs11 MSHFlexGrid1.Refresh '判断结果 If rs11.RecordCount > 0 Then '----------------------------------------- '判断记录总数 '----------------------------------------- Label7.Caption = rs11.RecordCount End If