MSHFlexGrid1问题
如何让MSHFlexGrid1显示数据库当中某一列的数据
MSHFlexGrid1.Visible = True MSHFlexGrid1.Clear Dim cn As New ADODB.Connection, RS As New ADODB.Recordset, XXT As Integer cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\用户信息.accdb;Jet OLEDB:Database Password=;" RS.Open "Select * From 用户表 where ID=" & Val(Text1.Text) & "", cn, 3, 2 XXT = RS.RecordCount With MSHFlexGrid1 .Cols = 2 .Rows = XXT + 1 .TextMatrix(0, 1) = "用户名" .ColWidth(0) = 0 .ColWidth(1) = 1000 For I = 1 To XXT .TextMatrix(I, 1) = RS!用户名 RS.MoveNext Next I RS.Close cn.Close
[此贴子已经被作者于2020-7-11 12:20编辑过]