急啊,求助(跳出无效使用null的错误)
Private Sub List1_Click()Text5.Text = List1.Text
Dim rs As ADODB.Recordset
sqlStr = "select * from data1 where 时间 LIKE '%" & Text5.Text & "%'"
Set rs = ExeCuteSQL(sqlStr, msgText)
If rs.RecordCount = 0 Then
MsgBox "没有查找满足条件的数据!", vbExclamation, "提示"
MSFlexGrid1.Rows = 1
' MSFlexGrid2.Rows = 1
Else
MSFlexGrid1.Rows = 2
' MSFlexGrid2.Rows = 21
rs.MoveFirst
While (Not rs.EOF)
MSFlexGrid1.TextMatrix(1, 0) = rs.Fields("日期")
MSFlexGrid1.TextMatrix(1, 1) = rs.Fields("时间")
MSFlexGrid1.TextMatrix(1, 2) = rs.Fields("浮标号") (调试就是这里出错)
rs.MoveNext
Wend
End If
rs.Close
End Sub
求解