vb6.0+Access数据库实现查询功能,通过选择查询条件,将数据库中符合条件的数据显示在表格中。
2个回答
展开全部
Private Sub RIQI()
str = "select * from 传感器融合"
Rs.Open str, Conn, 1, 3
For j = 1 To Rs.RecordCount
If Rs.Fields(2) = Text2.Text Then
Dim Fliv As ListItem
Set Fliv = ListView1.ListItems.Add(, , "")
Fliv.Text = Rs.Fields(0)
Fliv.SubItems(1) = Rs.Fields(1)
Fliv.SubItems(2) = Rs.Fields(2)
Fliv.SubItems(3) = Rs.Fields(3)
End If
Rs.MoveNext
Next j
Rs.Close
End Sub
在连接好数据库后,查询数据,并将其显示在listview控件中,希望对你有帮助
str = "select * from 传感器融合"
Rs.Open str, Conn, 1, 3
For j = 1 To Rs.RecordCount
If Rs.Fields(2) = Text2.Text Then
Dim Fliv As ListItem
Set Fliv = ListView1.ListItems.Add(, , "")
Fliv.Text = Rs.Fields(0)
Fliv.SubItems(1) = Rs.Fields(1)
Fliv.SubItems(2) = Rs.Fields(2)
Fliv.SubItems(3) = Rs.Fields(3)
End If
Rs.MoveNext
Next j
Rs.Close
End Sub
在连接好数据库后,查询数据,并将其显示在listview控件中,希望对你有帮助
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询