Dim sql As String
Dim i As Integer
Dim j As Integer
Call opensjk
sql = "select * from yhda "
rs.Open sql, sjk, 1, 1
MSFlexGrid1.Rows = rs.RecordCount - 1
MSFlexGrid1.Cols = rs.Fields.Count
For i = 1 To rs.RecordCount - 1
MSFlexGrid1.Rows = i
For j = 0 To rs.Fields.Count
MSFlexGrid1.Cols = j
MSFlexGrid1.Text = rs.Fields(j).Value
Next j
以上提示 MSFlexGrid1.Text = rs.Fields(j).Value 有错,不知这样写有没有问题啊。