看看这个问题,怎么解决了?帮帮忙?
我现在在做一个查询,通过文本框获得一个值,然后通过SQL语句来找符合这个条件的记录?
sjh=text1.text
sql:select * from shangme where shoujihao='sjh'
在执行下面的操作,但我就不知道sql对不对,因为,我返回的rs指针总在记录尾部!
Private Sub Command2_Click()
If Option2.Value = True Then
Dim sjh As Integer
Dim db As clsDBConn
Set db = New clsDBConn
sjh = Text1.Text
Set rs1 = db.getDbResultSet1("select * from shangmen where shoujihao='sjh'")
是不是这个SQL有问题哦!
Dim itemx As ListItem
While Not rs1.EOF --这里始终是true
Set itemx = ListView1.ListItems.Add
itemx.Text = rs1(0)
itemx.Key = rs1(0)
itemx.SubItems(1) = rs1(1)
itemx.SubItems(2) = rs1(2)
itemx.SubItems(3) = rs1(3)
itemx.SubItems(4) = rs1(4)
itemx.SubItems(5) = rs1(5)
itemx.SubItems(6) = rs1(6)
itemx.SubItems(7) = rs1(7)
itemx.SubItems(8) = rs1(8)
rs1.MoveNext
Wend
End If
End Sub
帮我看看!!是怎么回事!